Validating data javascript


For ‘selections’ like drop down and radio group, use an appropriate validation like ‘dontselect’ or ‘selone_radio’.



Take this simple booking form: attribute for the label tag matches up with the id attribute of the associated input tag.A Java Script check is useful because it stops the form from being submitted if there is a problem, saving lots of time for your readers.The CGI script is still more reliable, as it always works regardless of whether Java Script is enabled on the client-side or not; but having this extra safety barrier is a nice thing to have in place.This keeps our HTML semantic, with the labels helping to give meaning to the input controls.