Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:18 PM
Miguel Orrego
Guest
 
Posts: n/a
Default 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.


  #2  
Old July 19th, 2005, 02:18 PM
Curt_C [MVP]
Guest
 
Posts: n/a
Default Re: Form Validation

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" <miguel@stressedmonkey.net-nospam> wrote in message
news:40fd03f9$0$6445$ed9e5944@reading.news.pipex.n et...[color=blue]
> 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[/color]
7.0">[color=blue]
> 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[/color]
MX[color=blue]
> 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[/color]
before[color=blue]
> the form can be submitted, can this be done in asp? The
> amount of lines in the form will vary.
>
> Thanks.
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles