Validate a form using JavaScript

前端 未结 3 1311
长情又很酷
长情又很酷 2021-01-26 21:09

I am a beginner and I have written a code for validating the form as:

function validateForm(){
var x=document.forms[\"myForm\"][\"fname\"].value;
if (x==null ||          


        
3条回答
  •  旧时难觅i
    2021-01-26 21:48

    replace your input element's code by following

    
    

    i guess thats what you are looking for

提交回复
热议问题