Click to See Complete Forum and Search --> : Check Boxes


soccer362001
08-18-2003, 04:36 PM
Does anyone have a script that will only allow you to check on check box at a time??

Khalid Ali
08-18-2003, 06:04 PM
I am sure you can use a script like tthe one at this resource.
http://www.webapplikations.com/pages/html_js/forms/CheckBoxesLimitUserSelection.html

soccer362001
08-18-2003, 06:27 PM
Thats what I want but where is the script??

Khalid Ali
08-18-2003, 06:31 PM
Here is the script..

http://www.webapplikations.com/pages/html_js/scripts/limit-users-ability-select-checkbox.js

soccer362001
08-18-2003, 06:36 PM
I've got another problem. I have many forms that I want sent to my email. And I have to separate theses forms in order for the script to work.

soccer362001
08-18-2003, 06:52 PM
Here it is if this helps.

Khalid Ali
08-19-2003, 10:20 AM
There are few items in the html section that needed to be corrected.
Below is the corrected code for html part of copy and paste it


<form id="check" action="http://pub42.bravenet.com/emailfwd/senddata.php" method="post">
<input type="hidden" name="usernum" value="3565748791" />
<input type="hidden" name="cpv" value="2" />
<table cellpadding="10" cellspacing="0" border="0" style="width: 400px; border:solid 1px #969696;" align="center">
<tr>
<td width="50%" align="right">Enter Your Name:</td>
<td><input type="text" name="sample" value="" size="20" maxlength="40"></td>
</tr>
<tr bgcolor="#f6f6f6">
<td width="50%" align="right" style="border-top: solid 1px #969696;">Enter Your Email Address:</td>
<td style="border-top: solid 1px #969696;"><input type="text" name="sample" value="" size="20" maxlength="40"></td>
</tr>
<tr>
<td style="border-top: solid 1px #969696;">
Did you find what you were looking for?<br><br>

<input type="checkbox" name="yes" onclick="add(this);"/>Yes<br/>
<input type="checkbox" name="no" onclick="add(this);"/>No<br>
<input type="checkbox" name="maybe" onclick="add(this);"/>Maybe<br>
</td>

<td style="border-top: solid 1px #969696;">Do you like my site?<br><br>
<input type="radio" name="rate" value="absolutely" style="border:0px;"> Absolutely<br>
<input type="radio" name="rate" value="itsok" style="border:0px;"> It's ok<br>
<input type="radio" name="rate" value="idontcare" style="border:0px;"> I don't care<br>
<input type="radio" name="rate" value="itbad" style="border:0px;"> It's bad<br>
<input type="radio" name="rate" value="itstinks" style="border:0px;"> It stinks<br>
</td>
</tr>
<tr bgcolor="#f6f6f6">
<td align="right" style="border-top: solid 1px #969696;">Your favorite person in Texas History:</td>
<td style="border-top: solid 1px #969696;">
<select name="sample" size="1">
<option value="" SELECTED></option>
<option value="sh">Sam Houston</option>
<option value="jb">James Bowie</option>
<option value="dc">Davy Crockett</option>
<option value="sfa">Stephen F. Austin</option>
<option value="all">All of the above</option>
<option value="none">None of the above</option>
<option value="dontcare">I don't care</option>
</select>
</td>
</tr>
<tr >
<td colspan="2" align="center" style="border-top: solid 1px #969696;"><textarea cols="40" rows="4" name="text"></textarea><br><br>
<input type="submit" name="submit" Value="Submit Form">
<input type="reset" name="reset" value="Reset Form"></td>
</tr>
</table>
</form>


and delete this part of the code in the javascript part of the code( you do not need it)

if(ctr==allowedNumberOfSelections){
var str = "";
var z=0;
for(x=0;x<frm.length;x++){
if(frm[x].type=="checkbox" && frm[x].checked){
checkedArr[z++]=frm[x];
str+=("element name ["+frm[x].name+"]<br/>")
}
}
document.getElementById("msg").innerHTML = (str);
}

soccer362001
08-19-2003, 02:51 PM
Thanks it worked great.

Khalid Ali
08-19-2003, 02:53 PM
you are welcome...:D :D