471,119 Members | 1,169 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

Form Validation

Hi,

I have a form that is created dynamically from a recordset, this creates a
line for each record together with 2 checkboxes, Yes & No so the source
output would be something like this:

<p>Please indicate whether you still use each piece of software detailed
below:</p>
<form name="apps" method="POST" action="MyAction.asp">
<table width="600" border="1" cellspacing="0" cellpadding="5">
<tr bgcolor="#9999FF">
<td><font color="#FFFFFF"><strong> Software</strong></font></td>
<td><font color="#FFFFFF"><strong>Required?</strong></font></td>
</tr>

<tr>
<td>Adobe Photoshop 7.0 7.0</td>
<td><input type="checkbox" name="Yes" value="Adobe Photoshop 7.0 7.0">
Yes
<input type="checkbox" name="No" value="Adobe Photoshop 7.0 7.0">
No </td>
</tr>

<tr>
<td>Citrix ICA Client</td>
<td><input type="checkbox" name="Yes" value="Citrix ICA Client">
Yes
<input type="checkbox" name="No" value="Citrix ICA Client">
No </td>
</tr>

<tr>
<td>Macromedia Dreamweaver MX 6.0</td>
<td><input type="checkbox" name="Yes" value="Macromedia Dreamweaver MX
6.0">
Yes
<input type="checkbox" name="No" value="Macromedia Dreamweaver MX
6.0">
No </td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
</form>

And so on......

I want to ensure that either Yes or No has been checked for each line before
the form can be submitted, can this be done in asp? The
amount of lines in the form will vary.

Thanks.
Jul 19 '05 #1
1 1578
use radio button instead of checkbox, that's what it's for.
Then just use the "Selected" attribute to start off with one preselected
thus ensuring that there will always be one checked.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Miguel Orrego" <mi****@stressedmonkey.net-nospam> wrote in message
news:40**********************@reading.news.pipex.n et...
Hi,

I have a form that is created dynamically from a recordset, this creates a
line for each record together with 2 checkboxes, Yes & No so the source
output would be something like this:

<p>Please indicate whether you still use each piece of software detailed
below:</p>
<form name="apps" method="POST" action="MyAction.asp">
<table width="600" border="1" cellspacing="0" cellpadding="5">
<tr bgcolor="#9999FF">
<td><font color="#FFFFFF"><strong> Software</strong></font></td>
<td><font color="#FFFFFF"><strong>Required?</strong></font></td>
</tr>

<tr>
<td>Adobe Photoshop 7.0 7.0</td>
<td><input type="checkbox" name="Yes" value="Adobe Photoshop 7.0 7.0"> Yes
<input type="checkbox" name="No" value="Adobe Photoshop 7.0 7.0">
No </td>
</tr>

<tr>
<td>Citrix ICA Client</td>
<td><input type="checkbox" name="Yes" value="Citrix ICA Client">
Yes
<input type="checkbox" name="No" value="Citrix ICA Client">
No </td>
</tr>

<tr>
<td>Macromedia Dreamweaver MX 6.0</td>
<td><input type="checkbox" name="Yes" value="Macromedia Dreamweaver MX 6.0">
Yes
<input type="checkbox" name="No" value="Macromedia Dreamweaver MX
6.0">
No </td>
</tr>
</table>
<p>
<input type="submit" name="Submit" value="Submit">
</form>

And so on......

I want to ensure that either Yes or No has been checked for each line before the form can be submitted, can this be done in asp? The
amount of lines in the form will vary.

Thanks.

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Phil Powell | last post: by
4 posts views Thread by TG | last post: by
16 posts views Thread by Hosh | last post: by
9 posts views Thread by julie.siebel | last post: by
27 posts views Thread by Chris | last post: by
11 posts views Thread by Rik | last post: by
5 posts views Thread by lucyh3h | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.