NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page ASP-form validation

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-26-2006, 10:19 AM THREAD STARTER               #1 (permalink)
NamePros Member
 
crazyluv's Avatar
Join Date: Jan 2005
Posts: 97
crazyluv is an unknown quantity at this point
 



Question ASP-form validation


I am making a custom submission form for one of my webpages and was wondering what is the best way to validate the information entered into the form.

Should I use javascript with a pop-up button for errors or should I use ASP code to verify and redirect?

I want the contents of the form to remain intact since in would be a bit of an inconvience to have to rewrite everything, so if I go with ASP is there an easy way to repopulate a form or do I have to custom build it with variables? Including one for posting the error at the top of the page?

The page as various forms I have to submit one after another till everything is done, all of which are located on the same ASP page, is that ok?
__________________
AEInbetween
crazyluv is offline  
Old 03-26-2006, 01:45 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,552
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
You should use ASP (server-side) for validation purposes.
Some basic validation in javascript is also a plus (quicker and it prevents round trips between browser and server). But it may be disabled on the client browser.
Never ever rely on client-based validation !

Also you can program your form to call itself so that if errors are reported, it can remember the input on the previous screen so it need not be type in again.
__________________
NameNewsletter.com - free lists of available domain names
ZoneFiles.net (beta) - ccTLD and gTLD droplists
sdsinc is offline  
Old 03-27-2006, 12:22 PM THREAD STARTER               #3 (permalink)
NamePros Member
 
crazyluv's Avatar
Join Date: Jan 2005
Posts: 97
crazyluv is an unknown quantity at this point
 



I see your point, so ASP validation it is (I was leaning towards this anyway). May seem silly but how do I get it to call itself and retain it's values?
__________________
AEInbetween
crazyluv is offline  
Old 03-27-2006, 11:19 PM   #4 (permalink)
NamePros Member
Join Date: Oct 2005
Posts: 193
2knew has a spectacular aura about2knew has a spectacular aura about
 



Originally Posted by crazyluv
I see your point, so ASP validation it is (I was leaning towards this anyway). May seem silly but how do I get it to call itself and retain it's values?
Build the form and echo it with response.write.
????: NamePros.com http://www.namepros.com/programming/180730-asp-form-validation.html

sorta like

<%
response.write("<input type=hidden name=UID value=" & request.form("UID") & ">")
%>

Thats quick and cheesy. Someone could easily fake their header and pass you an unexpected/unwanted value. I prefer to vet the form values in the head and assign them to variables that you use to load the form...



<%

dim ok_value

' checks the value is a number.
' you'd probably want real bounds checking here..
if (isnumeric(request.form("UID"))) then

ok_value=request.form("UID")

end if
.
.
.

response.write("<input type=hidden name=UID value=" & ok_value & ">")

%>



Late at night and I'm pretty tired. apologies for any syntax errors
2knew is offline  
Old 03-28-2006, 01:47 PM THREAD STARTER               #5 (permalink)
NamePros Member
 
crazyluv's Avatar
Join Date: Jan 2005
Posts: 97
crazyluv is an unknown quantity at this point
 



Thanks! I'll try it out later. Muchas Gracias!
__________________
AEInbetween
crazyluv is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 06:37 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger