|
| |
|
|
womble
Posts: 5594 Joined: 3/14/2005 From: Living on the edge Status: offline
|
Quick question on submitting forms with ASP - 7/23/2006 15:22:43
I have a form that I need to submit the responses to to a text file, but I also need to validate the form input. (it's for a course I'm doing). My VbScript/ASP skills are not great and I know I've not done half of it 'properly' - current strategy is to just get anything that sort of works like it should submitted (yep, Wombly in panic mode). I've done the submitting to the text file, but I'm struggling to work out how to get the validation into the same script. Then I had an idea, I'm thinking that I could do the validation script so that if all the fields validate, then it triggers the second script. Something like: 1st SCRIPT HERE .... If Form_Valid = "false" Then response.redirect "formpage.asp" Else If Form_Valid = "true" Then response.redirect "secondscript.asp" <-- url of second script here which submits the form then redirects to the success page Would something like that work in theory or am I way off here?
_____________________________
~~ "A cruel god ain't no god at all" ~~
|
|
|
|
rdouglass
Posts: 9265 From: Biddeford, ME USA Status: offline
|
RE: Quick question on submitting forms with ASP - 7/23/2006 15:47:10
quote:
I also need to validate the form input. Is this something you can do Clientside with JavaScript? I do that often with various Javascripts. One I change the 'action' of the form tag on the fly. What is it you hope to accomplish if the form does not validate? Or maybe you want to do it all in ASP. If so, you may not want to bother with the redirects; you should be able to run most scripts directly if you choose: If Form_Valid = "false" Then 'run the script directly Else 'run the second script hereand then redirect to the success page End If I wish I knew more which direction you want to take this. As with most projects, there are many ways to do the little things but when you start looking at the bigger picture, some methods work better than others.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|