[HTML]<form name="package_information" id="package_information" method="post" enctype="multipart/form-data""& lt;"
<tr>
<td><input type="checkbox" name="FormListName" value="31" />Adobe client-server form</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="32" />Adobe XDP form</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="29" />Dispute Form (pff)</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="30" />SSA Form SSA-L996 (pff)</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="22" />Tax form 1040a (1)</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="23" />Tax form 1040a (2)</td>
</tr>
<tr>
<td><input type="checkbox" name="FormListName" value="28" />Tax form 1040a User Verification Required</td>
</tr>
.
.
.
.
<input type="button" value="Publish" onClick="javascript:doPackagesubmit();">
</form>
[/HTML]
Here are the relevent javascript functions
Expand|Select|Wrap|Line Numbers
- function getFormList()
- {
- var formListStr = null;
- var firstIteration = true;
- var formList = document.getElementById("package_information").getElementsByTagName("FormListName");
- if (eval(formList))
- {
- if (eval(formList.length != "undefined"))
- {
- if (formList.length == 0)
- {
- alert("Need to select atleast one form for a explicit package" );
- switchPage('page4'); switchnav('nav4');
- }
- for (i = 0 ; i < formList.length; i++)
- {
- if ((formList[i].checked))
- {
- if (firstIteration)
- {
- formListStr = formListStr+formList[i].value+","
- firstIteration = false;
- }else
- {
- formListStr = formListStr+formList[i].value;
- }
- }
- }
- }else
- {
- if (formList.checked == true)
- {
- alert("Only one checkbox is checked");
- }else
- {
- alert("formList is not checked");
- }
- }
- }else
- {
- alert("forms list does not exist");
- }
- return formListStr;
- }
Javascript function "doPackageSubmit" calls "getFormList".
Now here is my problem, irrepective of how many of the checkboxes i check i always get the message "Need to select atleast one form for a explicit package". What is that ?