Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get value from dynamically created checkboxes

Status
Not open for further replies.

donniea21

MIS
Feb 16, 2001
75
US
I have a page that dynamically creates checkboxes depending on which radio button a user chooses..The user can then select a checkbox(s)..if 3 checkboxes are created, thier names are HLTchk0, HLTchk1, HLTchk2 (not an array). The problem i am running into is when i submit the form i need to be able to read the values from each box that is checked and ignore the ones that are blank. These values are then going to be written to a db..Thanks for any help
 
You need to write a dynamical JavaScript to check your SELCET items button

<script language=&quot;JavaScript&quot;>
<!--
function whateverfunction() {
newURL='anewpage.asp?';
<%
For I = 0 to K 'number of selected items
response.write &quot;if (document.SelectName.options[document.SelectName.HLTchk&quot; & cstr(I) & &quot;.selectIndex].value !='') {&quot;
response.write &quot;newURL+=HLTchk&quot; & cstr(I) & &quot;=document.SelectName.options[document.SelectName.HLTchk&quot; & cstr(I) & &quot;.selectIndex].value; }&quot;

Next
%>
document.location.href=newURL;
}
//-->
</script>

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top