PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a PHP email form with a javascript validation that just refuses to send! When all required fields are filled in, and the form submitted, instead of directing to the results page, it gives me the error message instead. When i take out all the javascript, it sends and works fine, so i realise it may be more of a java problem than a PHP one, but anyhelp would be appreciated. Thank you!
Here's my PHP page,
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by antoniomb on Tue Aug 21, 2007 12:23 pm, edited 4 times in total.
I often build forms with a hidden element in them for this purpose <input type="hidden" name="form_sent" value="1" /> so I always have something to test against even if I change element names or add/remove elements of the form.
Thanks for that. I changed the first line of the PHP from 'submit' to 'message' to test it, but when i leave a field blank, the validation message pops up just fine, then as soon as i click ok to return to the form and fill in the missing field, it just sends automatically without anything being able to be filled in. Any ideas anyone? You can see it at http://www.lunatreejewellery.co.uk/ostrich.htm
Am i obviously out of my depth if i say i don't know how to do that one? Can anyone give me a hint of a suggestion as to what i should be writing to stop the form from submitting before all the fields are filled in, as above. Thank you.