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.

Recommended Answers

All 2 Replies


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.

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 .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.