![]() |
| |||||||
| Sponsored Links |
![]() | « Previous Thread | Next Thread » |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| Hi, I have 6 subject and each subject has 4 fields which the admin has fill. Out of 6 subjects the admin has to enter data for 4 subjects So here is the html design for it can someone tell me how my validation will be todd Code: <table> <thead> <tr> <th>Title</th> <th>CourseNo</th> <th>Course Hrs</th> <th>Instructor</th> <th>Room</th> </tr> </thead> <tr> <td>Maths</td> <td><input type="text" name="courseone" id="courseone" value=""></td> <td><input type="text" name="courseHrsone" id="courseHrsone" value=""></td> <td><input type="text" name="Instructorone" id="Instructorone" value=""></td> <td><input type="text" name="Roomone" id="Roomone" value=""></td> </tr> <tr> <td>Science</td> <td><input type="text" name="coursetwo" id="coursetwo" value=""></td> <td><input type="text" name="courseHrstwo" id="courseHrstwo" value=""></td> <td><input type="text" name="Instructortwo" id="Instructortwo" value=""></td> <td><input type="text" name="Roomtwo" id="Roomtwo" value=""></td> </tr> <tr> <td>Social Science</td> <td><input type="text" name="coursethree" id="coursethree" value=""></td> <td><input type="text" name="courseHrsthree" id="courseHrsthree" value=""></td> <td><input type="text" name="Instructorthree" id="Instructorthree" value=""></td> <td><input type="text" name="Roomthree" id="Roomthree" value=""></td> </tr> <tr> <td>Arts</td> <td><input type="text" name="coursefour" id="coursefour" value=""></td> <td><input type="text" name="courseHrsfour" id="courseHrsfour" value=""></td> <td><input type="text" name="Instructorfour" id="Instructorfour" value=""></td> <td><input type="text" name="Roomfour" id="Roomfour" value=""></td> </tr> <tr> <td>PT</td> <td><input type="text" name="coursefive" id="coursefive" value=""></td> <td><input type="text" name="courseHrsfive" id="courseHrsfive" value=""></td> <td><input type="text" name="Instructorfive" id="Instructorfive" value=""></td> <td><input type="text" name="Roomfive" id="Roomfive" value=""></td> </tr> <tr> <td>Social Studies</td> <td><input type="text" name="coursesix" id="coursesix" value=""></td> <td><input type="text" name="courseHrssix" id="courseHrssix" value=""></td> <td><input type="text" name="Instructorsix" id="Instructorsix" value=""></td> <td><input type="text" name="Roomsix" id="Roomsix" value=""></td> </tr> </table> |
| Sponsored Links |
|
#2
| ||||
| ||||
| Why are you using JavaScript to validate? Use ASP or another server side script.
__________________ "You'll never be as perfect as BLaaaaaaaaarche." |
|
#3
| ||||
| ||||
| Quote:
I'm not going to tell you how exactly...but using JavaScript you can iterate through those fields and check if they have a value. Keep a counter and if, by the end of the iteration, there are 4 values, then the validation should pass.
__________________ jmurrayhead If you agree with me... click the icon! If my post solved your problem, click the button in the lower right-hand corner of the post.Join our Folding team: DeveloperBarn Folding |
|
#4
| ||||
| ||||
| Fine with me, but I absolutely HATE websites that have a popup that says, "You are missing a required field". After I see that, I have to click it and say, "OK", and re-enter. A-N-N-O-Y-I-N-G! I rather submit the form and have the server kick back an error message on the page. I think it is cleaner and more professional looking. |
|
#5
| ||||
| ||||
| Quote:
|
|
#6
| ||||
| ||||
| Agreed -- but the client-side script doesn't HAVE to use a popup to indicate which fields are missing, invalid or whatever. I agree, it's much cleaner to put some kind of indication on the page near the missing field. Of course the ASP.NET validators make this kinda moot anyway.
__________________ Wolffy ------------------------ Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary. |
![]() |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| date validation | todd2006 | JavaScript Programming | 3 | July 6th, 2008 11:39 AM |
| textbox validation | todd2006 | JavaScript Programming | 6 | July 2nd, 2008 01:30 PM |
| checkbox validation | todd2006 | JavaScript Programming | 3 | June 18th, 2008 07:22 PM |
| [ASP.Net/VB.Net] Programmatically Add Item to Validation Summary | jmurrayhead | Code Samples | 0 | March 20th, 2008 09:41 AM |