View Full Version : call a function from jsp

03-17-2009, 05:36 AM
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

Old Pedant
03-17-2009, 07:10 AM
Nothing to do with JSP...this is pure JavaScript. So you are new to both JSP and JavaScript, apparently??

Wrong code:


Right code:


Having said that... The function should still have been called. It just would have been called with junk, not what you were expecting.