0

Dear all,
Let me tell you the scenario , i have called javascript function on radio button selection , Ex.
Suppose There are 3 Radio Button .
Let us consider i have clicked on one radio button then
javascript is called on that and
it get 'checked' But again if if i clicked on that radio ,
Then again it will call the javascript .
So i dont want to let it happen , If radio button value got changed then only javascript should call

Please help.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by gskoli
0

Hi,

Some ideas here;

1) You can check the radio button value in the javascript and execute the action. for example like;

if (document.getElementById("RadioButton1").checked == true){<do action>}

2) Adding events for radio button in page_load()

RadioButton1.Attributes.Add("onclick", "javascript:return alertme();");

You can play with these and update us if you found the expected results.


Thank you.

0

Thanks to reply guys ,
Well i dint got expected result let me give you some snippet of the code.

<input type='radio' name='productradio' id='proname' value='prod_name'  onClick='document.frm.submit();' />Product Name&nbsp;&nbsp;
-<input type='radio' name='productradio' id='procode' value='prod_code' onClick='document.frm.submit();' />Product Code&nbsp;&nbsp;
-<input type='radio' name='productradio' id='cat_name' value='cat_name' onClick='document.frm.submit();' />Category Name&nbsp;&nbsp;
-<input type='radio' name='productradio' id='cat_code' value='cat_code' onClick='document.frm.submit();' />Category Code

Now if i have selected Category Name and again i am selecting that
then form should not submit .

Edited by gskoli: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.