|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a client I am working with where I am taking a Word document, basically turning it into an HTML document, and making certain field in the form required such as check boxes and/or text boxes. #1, how do I go about making field required? I have a couple options in the form such as you can pick from CHOICE 1 OR CHOICE 2, both cannot be selected, however, one of them must be selected.
#2, when the user is done with all the required selections, we need it to produce a printer-friendly version of this form so all the salespeople nee to do is print it, and have them and the client sign it. We are trying to make it so this is as fool-proof as possible and all the necessary fields are filled in leaving nothing to question. It would be kind of cool to also have the fiels turn red if the user does not fill everything in the first time, but this is just more for looks and ease of use, not necessarily needed. Suggestions? Any help would be a tremendous help. Thanks, Chad |
|
#2
|
||||
|
||||
|
For #1, you can use Javascript to validate the form. In your form, set the function that will validate the form. This example requires that a user enter a value in the "t1" textbox (you can do the same for checkboxes and radiobuttons with slightly different code):
<html> <head> <title>hello</title> <script language="javascript"> function validateMe(form) { if ( form.t1.value="" ) { alert("Please enter a value."); return false; } return true; } </script> </head> <body> <form name="form1" method="post" onSubmit="return validateMe(this);"> <input type="text" name="t1" value=""> <input type="submit" name="submit" value="Submit"> </form> </body> </html> |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Printer Friendly pages..... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|