mrferrari
asked on
ASP.Net change radio button via javascript from onblur attribute
Please help. I have a radio button group with two buttons and one text box. If the user clicks into and then out of the text box I want to check if the user has changed the value from the default (which is 0) and if the user has changed the value I want the radio button to automatically switch to yes (which is the second item in the radio button group index).
I added the onblur attribute to my textbox and have tried to get the javascript going with all sorts of methods to no avail...
I added the onblur attribute to my textbox and have tried to get the javascript going with all sorts of methods to no avail...
tbxBid.Attributes.Add("onblur", String.Format("CheckBoxChange(this.value,{0},{1});", tbxBox.ClientID, rdbGroup.ClientID))
<script type="text/javascript">
function CheckManualEntry(value, txtBoxName, rdbName) {
var old_price = txtBoxName.getAttribute("value");
var rb = document.getElementsByName(rdbName);
rb[1].checked = true;
}
</script>
ASKER
I want to use javasciprt. this is really small and simple. i cant figure it out though.
I don't want the page to autopostback...
I don't want the page to autopostback...
http://dotnetslackers.com/articles/aspnet/JavaScript_with_ASP_NET_2_0_Pages_Part1.aspx
tbxBid.Attributes.Add("onb lur", PASTE_FUNCTION_HERE)
tbxBid.Attributes.Add("onb
I don't understand the scope beyond just the basics you outlined. I was a little confused by your attribute assignment in the code behind because you were calling on ID's that you hadn't mentioned in your question (tbxBid and tbxBox). All that is to say I may have missed the mark because I had to simplify without having more information...
Anyway this should give you an idea of how to begin managing the situation. I just wrote something that addresses the very specific things you mentioned. Of course I imagine you have a bigger scope and will have to update it accordingly...
Anyway this should give you an idea of how to begin managing the situation. I just wrote something that addresses the very specific things you mentioned. Of course I imagine you have a bigger scope and will have to update it accordingly...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
bingo bango... that works great. thanks so much...
set your autopostback to true.
add an ontextchanged event handler.
AJAX it.