Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > call JavaScript function from asp

Reply
Thread Tools

call JavaScript function from asp

 
 
Joe T
Guest
Posts: n/a
 
      02-23-2010
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call function whose function call with arguments is in astring Options grbgooglefan C Programming 4 01-30-2008 05:12 PM
How to call function whose function call with arguments is in astring grbgooglefan C++ 2 01-30-2008 07:18 AM
How to call function whose function call with arguments is in astring Options grbgooglefan C Programming 0 01-30-2008 04:19 AM
defined? for recursive function call v/s defined? for function call stack Alok Ruby 3 04-13-2006 11:53 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM



Advertisments