Note that there are some explanatory texts on larger screens.

plurals
  1. POwhy does javascript skip some of my functions?
    primarykey
    data
    text
    <p>when i run this program the validatePhone();, validateAddress(); and validateCity(); are completely skipped, why? heres my JS:</p> <pre><code>function validatePage() { var valid = false;//sets valid. var msg = "";//sets message to blank. validateFname(); function validateFname() { var fnameTxt = /^[a-zA-Z]+$///sets valid inputs for recipient name. if(firstName.value.match(fnameTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } validateLname(); } function validateLname() { var lnameTxt = /^[a-zA-Z]+$///sets valid inputs for recipient name. if(lastName.value.match(lnameTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } validatePhone(); } function validatePhone() { var nameTxt = /^[0-9]+$///sets valid inputs for recipient name. if(Phone.value.match(nameTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } validateAddress(); } function validateAddress() { var addressTxt = /^[0-9a-zA-Z]+$///sets valid inputs for recipient name. if(address1.value.match(addressTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } validateCity(); } function validateCity() { var cityTxt = /^[a-zA-Z]+$///sets valid inputs for recipient name. if(cityTown.value.match(cityTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } validatePostcode(); } function validatePostcode() { var postcodeTxt = /^[0-9a-zA-Z]+$///sets valid inputs for recipient name. if(postcode.value.match(postcodeTxt))//checks if there has been an entered value, then sets valid to true. { valid = true; } else { valid = false; } } if(valid == true) { window.open("checkout_step_5.html"); } else { msg="Not all required fields were filled." alert(msg); return false; } } </code></pre> <p>i checked for spelling mistakes and there is none well none that i have noticed i really dont know why this isnt working?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload