Form validation

  • drburt
  • Born
  • Born
  • drburt
  • Posts: 2

Post 3+ Months Ago

On one page of my website I have a form with input for Name, Email, Subject and Textbox for input. The form works OK for sending anything but I want to use a Javascript to validate that the proper info is entered into the form b/4 it is sent to the server. I have tried several different Javascripts but none of them gives a message to the sender that no info or the wrong info is being sent.

Do you have any ideas why I can't get these to work?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • claireo
  • Beginner
  • Beginner
  • claireo
  • Posts: 62
  • Loc: Coventry

Post 3+ Months Ago

This is the code i use for a call back form: The name being 'formhandler

function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
<!-- Begin
var submitcount=0;

function reset() {
document.callback.name.value="";
document.callback.phone.value="";
}
function checkFields() {
if (
(document.callback.name.value=="") ||
(document.callback.phone.value==""))
{
alert("Please enter a contact name and phone number.");
return false;
}

else
{
if (submitcount == 0)
{
submitcount++;
return true;
}
else
{
alert("This form has already been submitted.");
return false;
}
}
}

This asks for the name and phone number, so if you change the areas to match the input fields.
  • drburt
  • Born
  • Born
  • drburt
  • Posts: 2

Post 3+ Months Ago

Thanks for the reply but I guess I am out of luck. My IP tells me that their platform for form handling does not support Javascript.

Thanks again.
  • roje0913
  • Student
  • Student
  • roje0913
  • Posts: 78

Post 3+ Months Ago

here is a link that show some form validation via php, im sure you could also google some others:
http://www.php-mysql-tutorial.com/form- ... th-php.php

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 80 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.