This may be an ASP question but i think it is more of a JS question.
I have a web form that i want to have database values loaded into. I have (and want) the form defaulting to unfilled. I now have it checking and updating most the fields if a recordId is added into the url using ASP. My problem lies in changing the radio values.
Here are some snipets of what I have to try to do this that isn't working.
-here is how i have the radios set up
Expand|Select|Wrap|Line Numbers
- Yes <input name="isDelegate" type="radio" value="yes" onclick="changeDiv('delegate','block')" />
- No <input name="isDelegate" type="radio" value="no" onclick="changeDiv('delegate','none')" checked="checked" />
-here is the JS function
Expand|Select|Wrap|Line Numbers
- function setRadio(FormObj,stringvalue) {
- If(stringvalue == 'yes'){
- FormObj.isDelegate[0].checked = true;
- }
- }
-here is how i am calling it from ASP within the bottom of the form.
Expand|Select|Wrap|Line Numbers
- <%
- Response.write("<script type='text/javascript'>")
- Response.write("setRadio(this.form,'" & GR("isDelegate") & "');")
- Response.write("</script>")
- %>
I also tried testing it hardcoding the function call in JS as
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- setRadio(this.form,'yes');
- </script>
If anyone can help me it would be greatly appericiated!!