call JavaScript function from asp

Discussion in 'ASP General' started by Joe T, Feb 23, 2010.

  1. Joe T

    Joe T Guest

    I am using Access database, ASP, and some Javascript.
    A Group of two radio buttons.
    Button "noshow" updates a record and calls a javascript function. The
    javascript function puts a value in a hiddenfield.
    Button "show" updates the same record and places a different value in
    the same hiddenfield without using the javascript function.

    <label>
    <input name="RadioGroupA" type="radio" id="noshow"
    value="&lt;!--" <% If Recordset2("image_code_A")="<!--" Then %> checked
    <% End if %> onclick="doItA(this);"/>
    noshow</label>
    <br />
    <label>
    <input name="RadioGroupA" type="radio" id="show" <% If
    Recordset2("image_code_A")="" Then %> checked <% End if %>
    onclick="document.getElementById('hiddenFieldNo').value=" value="""/>
    show</label>

    javascript function:
    function doItA(obj){
    obj.form.elements['hiddenFieldNo'].value = "-->";
    }

    When either button is clicked and then Submit, the database gets updated
    with the new values and the asp page returns displaying the checked
    radio button.
    When noshow button is clicked, and submitted, it works fine. The problem
    is, when the asp page returns, if the Submit button is clicked again,
    the javascript function does not get called even though the noshow
    button displays "checked". Even though the noshow button displays
    "checked" I would have to click the noshow button again, and then hit
    Submit for the page to call the javascript function.
    Is there a way to have the previously checked noshow radio button work
    without having to click it again and work by just Submit the page?
    Joe T, Feb 23, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. grbgooglefan
    Replies:
    2
    Views:
    417
    Pascal Bourguignon
    Jan 30, 2008
  2. grbgooglefan
    Replies:
    4
    Views:
    437
    Kenny McCormack
    Jan 30, 2008
  3. grbgooglefan
    Replies:
    0
    Views:
    388
    grbgooglefan
    Jan 30, 2008
  4. Alok
    Replies:
    3
    Views:
    246
  5. THAKUR PRASHANT SINGH

    Class Function call vs Normal Function call

    THAKUR PRASHANT SINGH, Feb 26, 2010, in forum: Ruby
    Replies:
    7
    Views:
    185
    THAKUR PRASHANT SINGH
    Feb 27, 2010
Loading...

Share This Page