Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 2.33 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-17-2009, 04:36 AM   PM User | #1
javaguy1007
New Coder

 
Join Date: Mar 2009
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
javaguy1007 is an unknown quantity at this point
call a function from jsp

I am new to JSP

I have implemented 4 radio buttons,
when user clicks on a radio button , it should automatically a function in .js

<input type="radio" name= "publication" value= "value1" id="1234" onclick="myfunction('this.value')">r1<input type="radio" name= "publication" value= "value2">r2<input type="radio" name= "publication" value= "vaue3">r3<input type="radio" name="publication" value="r4">r4

I have this function in .js

function myfunction(siteid)

when I clcik on radio button r1 , the function is not getting called
help me
Thanks in advance
bye
Javaguy
javaguy1007 is offline   Reply With Quote
Old 03-17-2009, 06:10 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,237
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Nothing to do with JSP...this is pure JavaScript. So you are new to both JSP and JavaScript, apparently??

Wrong code:

onclick="myfunction('this.value')"

Right code:

onclick="myfunction(this.value)"

Having said that... The function should still have been called. It just would have been called with junk, not what you were expecting.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
javaguy1007 (03-19-2009)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 03:51 PM.


Advertisement
Log in to turn off these ads.