View Full Version : Html form help

01-26-2005, 10:48 PM
I have decided to create an aup for a network setup and i have created a small html page i have little experience with forms and would like some assistance if possible.

here is the code


<title>Untitled Document</title>

<p>policy here!!!</p>
<p>If you agree to these terns and conditions check the box and click submit.</p>
<form name="form1" method="post" action="http://www.yahoo.co.uk">
<input type="checkbox" name="checkbox" value="checkbox">
I agree to the terms and conditions</p>
<input type="submit" name="Submit" value="Submit">

Basically I want to link the checkbox and the submit button together so that they cannot continue without selecting the box and then it forwards them onto a site for instance www.yahoo.co.uk. If at all possible I would like a prompt if they do not check the box basically stopping them from going anywhere but the page until the accept the policy which i will put it once i get the form working correctly. Im new it may look stupid but i dont have much html experience so any help or suggestions would be greatly appreciated.



not wanting too much maybe i could also add a field where the username must be put in and gets sent in file to an email address or a log file would be handy if this is possible!!

01-26-2005, 11:33 PM
Hi Bud, welcome to the forums...

Well, to do what you are asking (not send a form if a field isn't filled in) is a bit out of the bounds of html and more into Javascript or a server-side language. I'd pick which one you have more experience with (or, in my case, are least afraid of :D) and pm a moderator to move this message into the appropriate forum (pleeease don't crosspost).

For something like this it'd honestly be easier to ask Google, then you could get something to copy and paste, unless you'd like to learn more.

If you have any questions about the html of your forms in particular, though, I'd be glad to help :)

01-26-2005, 11:34 PM

First, you may want to brush up on your HTML forms and how to use them...

Next, you may want to learn the fundamentals of a server-side language like PHP, that will allow you to validate form fields and add usernames to a log file, or email usernames to yourself...

The code you have attempted to forge there is little more than the tip of the iceburg, as far as what you want to accomplish....

Find yourself a good tutorial on HTML forms and PHP programming...do a Google search, there are plenty...

Once you get going with the PHP programming, do a search on "form validation" to fix your form/checkbox issue....

There are "filesystem functions" in PHP that will allow you to add usernames to a text (or log) file....do a Google search on "filesystem functions"......

The PHP "mail function" will allow you to e-mail HTML form fields to yourself...

Good luck! :)