|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can anyone give some suggestions of form validations using VBScript.
I have all the fields except the Drop down boxs and radio button. For the other required fields I just used reg expressions, but I'm stuck on the last two. No for the radio button I'm trying to leave it open so if there are any added in the future then the code would only have to be changed in one place. So I set the values at 1,2,3 etc.. The checkboxes are to stay the same though. Thanks |
|
#2
|
|||
|
|||
|
?
are you looking for a vb app to validate your html? if you are here's a link to goto for the code.
Client-Side Validation of HTML Form Data Using VB Script http://www.freevbcode.com/ShowCode.asp?ID=879 hope this helps, if i miss understood your question sorry!! |
|
#3
|
|||
|
|||
|
I don't know if this is the best practice, but I validate choices from the drop down by passing the value to a variable and then testing the variable with an if statement ie.
dim strSubject strSubject = request.form("Subject") if strSubject="Choice A" then response.redirect("ChoiceAPage.htm") Hope this helps you out. After originally posting this I realized it was written for Javascript, but think that the idea and context will be similar in VB. Last edited by BStanko : March 16th, 2005 at 03:19 PM. Reason: Realized mistake in post |
|
#4
|
||||
|
||||
|
you should not use client side vbscript because it would work only for IE browsers. other browsers will simply ignore it. since IE is less than 90% of the market, you can't really ignore the other browsers used by many millions of people around the world.
|
|
#5
|
||||
|
||||
|
Quote:
I wish my manager thought like that Elija |
|
#6
|
||||
|
||||
|
Quote:
Another way to look at this would be...IE makes up almost 90% of all users browsers, so why code for the other 10%??? I'd rather be right almost 90% of the time, than just over 10% of the time. but that's just bad logic.... Javascript should always be used for client-side validation. |
|
#7
|
||||
|
||||
|
javascript works both for IE and for other browsers... boss asking you to program in client side vbscript is 100% ignorant and is making fatal business mistake. anything you can do using vbscript you can also do in javascript. in my opinion, forcing the users to have one specific browser is brutal behaviour and I personally would ban such website and would never visit it or pay it any attention as it's not worth it.
|
|
#8
|
||||
|
||||
|
Quote:
/me agrees ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > VBScript |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|