473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1744
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now...
4
by: TG | last post by:
I have a validation form that must behave differently based on the results of a PHP validation check. I have a post command at the top of my form that calls itself. I don't leave the form when...
4
by: bnp | last post by:
Hi All, I am quite new the JavaScript. Basically I am a C++ programmer, but now I am working on JavaScript since last 5 days. I have a problem regarding the form validation. I have created a...
16
by: Hosh | last post by:
I have a form on a webpage and want to use JavaScript validation for the form fields. I have searched the web for form validation scripts and have come up with scripts that only validate...
9
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
10
by: gweasel | last post by:
What is the best way to apply a Validation Rule - or rather, where is the best place to put it? Is there an advantage to putting it on the field in the table vs setting the validation rule on the...
5
by: lucyh3h | last post by:
Hi, I am trying to use XMLHttpRequest to do server side validation. I have several fields on a form and a submit button. The submit button has an event assocated with it when clicked. The...
7
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.