javascript - HTML form validation using JS -
I am creating form validation, but how can using preg_match check in variable works just for empty fields Is doing this, but its not enough any advice?
var tekst = / ([a-zA-Z0-9] | [a-zA-Z0-9]) /; Var myForm = document.forms.formaa; Var prek = myForm.elements ['preke']; Var kina = myForm.elements ['kina']; Var k = myForm.elements ['kiekis']; Var uzsak = myForm.elements ['uzsakymas']; If (uzsak.value == '') {Warning ("Needs Spilled"); return false; } (Var i = 0; i & lt; prek.length; i ++) {var preke = prek [i]; Var Kei = Canna [I]; Of Var = of [ii]; If (preke.value == '' || (preke.value). Test (tekst) == incorrect) {alerts ("nezspined"); return false; } If (kai.value == '') {Warning ("Needs Spilled"); return false; } If (kie.value == '') {Warning ("Needs Spilled"); return false; }}
You can also use this way,
if (x == faucet | x == "") {/ document.getElementById ('name'). InnerHTML = "Fill in the name"; }
For this one you help
Comments
Post a Comment