Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > html question (check box)

Reply
Thread Tools

html question (check box)

 
 
lrbtav@gmail.com
Guest
Posts: n/a
 
      10-23-2006
Hi, I have a site with a built in 'contact us' form; how can I force
the user to check a certain check box before allowing them to submit
the form? This site is hosted on an ASP enabled godaddy server, but I
figured there was some html or js function that would accomplish this.
Thanks

 
Reply With Quote
 
 
 
 
Nico Schuyt
Guest
Posts: n/a
 
      10-23-2006
wrote:
> Hi, I have a site with a built in 'contact us' form; how can I force
> the user to check a certain check box before allowing them to submit
> the form? This site is hosted on an ASP enabled godaddy server, but I
> figured there was some html or js function that would accomplish this.


HTML: impossible
JS: unreliable
Handle it in ASP after the form is submitted

--
Nico Schuyt
http://www.nicoschuyt.nl/


 
Reply With Quote
 
 
 
 
Rik
Guest
Posts: n/a
 
      10-24-2006
Nico Schuyt wrote:
> wrote:
>> Hi, I have a site with a built in 'contact us' form; how can I force
>> the user to check a certain check box before allowing them to submit
>> the form? This site is hosted on an ASP enabled godaddy server, but I
>> figured there was some html or js function that would accomplish
>> this.

>
> HTML: impossible
> JS: unreliable
> Handle it in ASP after the form is submitted


Well, TRY to handle it with JS, but make sure of it on the server. It saves
a lot users an unneccessary trip to the server, get the contents, load the
page, just to get the error that he forgot to check a box after.
--
Rik Wasmus


 
Reply With Quote
 
tcremer@gmail.com
Guest
Posts: n/a
 
      10-24-2006
In the form tag add an onsubmit which calls a JavaScript function to
check whether your checkbox is actually checked. If it isn't return
false with a message of some kind. If it is checked, return true and
then (as others have said) check via ASP to ensure the box was checked.

Easy enough..


On Oct 22, 6:47 pm, lrb...@gmail.com wrote:
> Hi, I have a site with a built in 'contact us' form; how can I force
> the user to check a certain check box before allowing them to submit
> the form? This site is hosted on an ASP enabled godaddy server, but I
> figured there was some html or js function that would accomplish this.
> Thanks


 
Reply With Quote
 
Nico Schuyt
Guest
Posts: n/a
 
      10-24-2006
Rik wrote:
> Nico Schuyt wrote:
>> wrote:
>>> Hi, I have a site with a built in 'contact us' form; how can I force
>>> the user to check a certain check box before allowing them to submit
>>> the form? This site is hosted on an ASP enabled godaddy server, but
>>> I figured there was some html or js function that would accomplish
>>> this.


>> HTML: impossible
>> JS: unreliable
>> Handle it in ASP after the form is submitted


> Well, TRY to handle it with JS, but make sure of it on the server.
> It saves a lot users an unneccessary trip to the server, ...


But makes things unneccessary complex due to the double validation

--
Nico Schuyt
http://www.nicoschuyt.nl/


 
Reply With Quote
 
lrbtav@gmail.com
Guest
Posts: n/a
 
      10-27-2006
To use a JS function, would something like this work:

function checkscript() {
if (window.document.form.BoxChecked.checked=false) {
alert('Warning: Please agree to our terms of service.');
return false;
}
else if (window.document.form.BoxChecked.checked=true) {
alert('Thank you for your business!');
return true;
}

? thanks

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
How do I identify word<html><html>other word? Laura Perl 1 06-04-2004 11:32 PM
regexp question + html::parser question on the side boris bass Perl Misc 4 09-27-2003 02:24 AM
how to redirect to a frames-based html page and load the right html when coming from an ASP.NET page Mark Kamoski ASP .Net 1 08-13-2003 05:51 AM
How to use HTML::Parser to remove HTML tags and print result Mitchua Perl 1 07-15-2003 02:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57