Results 1 to 7 of 7
  1. #1

    Question Form Validation Help

    Hi,
    I am trying to fix a problem I have with a client's website. If you go to http://www.asretc.org/onlineinscriptionasretc.html and fill in the form correctly then it leads you to a page saying the from has been sent successful. This is fine.

    But when you fill in the form with errors and click the submit button, you are redirected to a white page that shows what errors you have made. (You can see this by going to the link above and clicking the send button without inputting any information).

    I do not like the way this looks and neither does my client. How would I make it so the validation shows the errors on the form or in a popup?

    This needs sorting very quickly and would appreciate it if someone could give me a step by step guide to fixing it?

    This is a live running website so I would appreciate it if you didn't send a completed form.

    Thank you in advance
    Rob

  2. #2
    How would I make it so the validation shows the errors on the form or in a popup?
    Why is that? Isn't it better if when clicking "send" if there are not filled fields, those to be marked somehow instead?

  3. #3
    Quote Originally Posted by GreenHornet View Post
    Why is that? Isn't it better if when clicking "send" if there are not filled fields, those to be marked somehow instead?
    Thanks for your reply, I'm not sure what you are getting at. Basically if someone clicks send and there are unfilled fields then it would show the error on the form itself.

    Thanks
    ROb
    PlusNet Host Super fast hosting 24/7 Support cPanel Domain Names VPS Free Instant Setup www.plusnethost.com

  4. #4
    Oh I misread it, my bad. Take a look here: http://www.sitepoint.com/form-validation-with-php/ it might help you to solve your problem. Also take a look at the comments, there is custom validation function which might be useful.

  5. #5
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    How were those .html pages originally generated? The problem you have is that you're apparently not starting from the position of using a PHP script generate the page - if you were you could simply add some markup to highlight fields that weren't filled in properly. As it is you probably have to try to combine the .html page with the PHP sendmail script, which is likely to end up as a bit of a lashup.

    The other option you might consider is a javascript (eg. jQuery) validator. You'd still need to server-side validation as well to catch people with javascript disabled but most visitors would just see the corrections / prompts appear instantly on the page.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  6. #6
    Join Date
    Sep 2002
    Location
    Coimbatore, India
    Posts
    103
    Please you may use the below link as a reference, and as Chris stated we could have the php script for the page itself rather calling it after an action.

    http://www.w3schools.com/php/php_forms.asp

  7. #7
    Thanks for the replies, the website was made by the client in SiteGrinder. I will look at all the suggestions and may consider re-writing the form from scratch.

    Thanks
    Rob
    PlusNet Host Super fast hosting 24/7 Support cPanel Domain Names VPS Free Instant Setup www.plusnethost.com

Similar Threads

  1. Form Validation and Permutation?
    By nickia in forum Programming Discussion
    Replies: 7
    Last Post: 08-28-2009, 05:59 AM
  2. form validation isNaN
    By djacks89 in forum Programming Discussion
    Replies: 1
    Last Post: 01-19-2006, 02:15 AM
  3. Form Validation w/o using JS
    By GWDGuy in forum Programming Discussion
    Replies: 5
    Last Post: 08-25-2005, 11:53 PM
  4. Form Validation Help
    By Dnslinux in forum Programming Discussion
    Replies: 5
    Last Post: 12-18-2004, 04:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •