User Profile

Collapse

Profile Sidebar

Collapse
MidnightSun
MidnightSun
Last Activity: Nov 6 '06, 05:51 AM
Joined: Apr 23 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • MidnightSun
    started a topic Embbeded Ruby (erb) from Javascript

    Embbeded Ruby (erb) from Javascript

    I am wondering if it is possible to set embedded ruby variables in javascript. I've tried but to no avail. I'm thinking the javascript block won't recognize the <% %> erb tags.

    What I want to do is basically call a javascript function from an onclick="setFie ld('first_name' )"

    function setField(name)
    {
    <% fieldName = name %>
    }

    I don't think it's possible, because...
    See more | Go to post

  • MidnightSun
    started a topic Finding next ID auto increment

    Finding next ID auto increment

    I'm having trouble trying to find the next ID in a mysql table which is set to autoincrement. I would like to retrieve this before the record is created so I can store its ID as a foriegn key with into another table.

    I've tried a query

    SELECT Max(ID) nextID FROM screenings

    But I found this works until I delete the most recently created records because the Max ID is no longer the one previous of the next...
    See more | Go to post

  • MidnightSun
    started a topic Javascript form object name from string

    Javascript form object name from string

    I'm having trouble trying to access textfield through javascript by using a string of it name to reference the object. For example

    Code:
     function toggle(num){ 
    document.form.paragraph_1.readOnly=!document.form.paragraph_1.readOnly;
    }
    When clicking on a link which calls this function, it will toggle a paragraph's readOnly ability. However I'm hardcoding in paragraph_1 as the name of the textfield. I want...
    See more | Go to post
    Last edited by Niheel; Apr 23 '06, 04:44 PM.
No activity results to display
Show More
Working...