How do you validate a form but also get information from one form to the other using JavaScript
?
I can get the information from a field using the getElementById
, but i cannot seem to validate the form.
//Iam trying to build a drivers license renewal form
//This is my JavaScript code
//Iam retrieving from one form and showing it on a different form.
function validateForm(){ // i tried this code but it doesnt seem to work
var x = document.forms["licenceform"]["surname_value"].valueOf;
if (x == null || x == "") {
alert(" Surname name must be filled out");
return false;
}
}