[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

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


Closed Thread
 
LinkBack Thread Tools
Old 03-26-2006, 09:19 AM   #1 (permalink)
NamePros Member
 
crazyluv's Avatar
 
Join Date: Jan 2005
Posts: 98
213.00 NP$ (Donate)

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, 12:45 PM   #2 (permalink)
Domains my Dominion
 
sdsinc's Avatar
 
Join Date: Aug 2005
Location: Web 1.0
Posts: 6,285
1,095.94 NP$ (Donate)

sdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond repute

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
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.
__________________
Buy now - MassDeveloper.com $500
sdsinc is offline  
Old 03-27-2006, 11:22 AM   #3 (permalink)
NamePros Member
 
crazyluv's Avatar
 
Join Date: Jan 2005
Posts: 98
213.00 NP$ (Donate)

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, 10:19 PM   #4 (permalink)
NamePros Member
 
Join Date: Oct 2005
Posts: 191
3,301.75 NP$ (Donate)

2knew has a spectacular aura about2knew has a spectacular aura about


Quote:
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.

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, 12:47 PM   #5 (permalink)
NamePros Member
 
crazyluv's Avatar
 
Join Date: Jan 2005
Posts: 98
213.00 NP$ (Donate)

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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 08:02 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85