HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 16th, 2005, 11:54 AM
bears13 bears13 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 21 bears13 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 22 m
Reputation Power: 0
Red face VBScript

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

Reply With Quote
  #2  
Old March 16th, 2005, 01:30 PM
hack_programr hack_programr is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: akron, ohio
Posts: 33 hack_programr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 1 m 36 sec
Reputation Power: 0
?

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!!

Reply With Quote
  #3  
Old March 16th, 2005, 02:11 PM
BStanko BStanko is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 7 BStanko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 39 m
Reputation Power: 0
Smile

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

Reply With Quote
  #4  
Old March 18th, 2005, 04:02 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,628 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 23 m 57 sec
Reputation Power: 1902
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.

Reply With Quote
  #5  
Old March 18th, 2005, 04:20 PM
elijathegold's Avatar
elijathegold elijathegold is offline
Senior Fire Wizard
Click here for more information
 
Join Date: Feb 2005
Location: Ashford, Kent. England
Posts: 5,651 elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)elijathegold User rank is Captain (20000 - 30000 Reputation Level)  Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4Folding Points: 1706335 Folding Title: Super Ultimate Folder - Level 4
Time spent in forums: 2 Months 2 Weeks 2 Days 4 h 21 m 19 sec
Reputation Power: 301
Quote:
Originally Posted by Shadow Wizard
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.

I wish my manager thought like that

Elija

Reply With Quote
  #6  
Old March 18th, 2005, 05:15 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
ASP Free God 14th Plane (11500 - 11999 posts)
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,776 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 15 m 35 sec
Reputation Power: 470
Quote:
Originally Posted by Shadow Wizard
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.

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.

Reply With Quote
  #7  
Old March 18th, 2005, 07:29 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,628 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1Folding Points: 372965 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 2 h 23 m 57 sec
Reputation Power: 1902
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.

Reply With Quote
  #8  
Old March 18th, 2005, 07:35 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Loyal (3000 - 3499 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,396 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 3 Days 11 h 13 m 11 sec
Reputation Power: 307
Facebook
Quote:
Originally Posted by Shadow Wizard
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.

/me agrees

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > VBScript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT