This is simply to validate html text boxes for a beginner without using complex JavaScript codes. I have tried this in php Code Igniter framework in NetBeans IDE 7.3 as well.
Your html code for text box will look like this
<input type="number" min="0" max="100" class="form_text" id="marks" name="marks" required />
Using min and max properties you can minimum and maximum value allowed for a particular text box
required ,does not allow empty text boxes
type="number" ,allows positive and negative integers including 0
type="number" step="any" , allows positive and negative decimal values including 0
type="text" , allows any character thus you need to verify it by your own. Using min and max properties with this doesn't make any sense.
(specifying min, max, required and type properties are optional)
Your html code for text box will look like this
<input type="number" min="0" max="100" class="form_text" id="marks" name="marks" required />
Using min and max properties you can minimum and maximum value allowed for a particular text box
required ,does not allow empty text boxes
type="number" ,allows positive and negative integers including 0
type="number" step="any" , allows positive and negative decimal values including 0
type="text" , allows any character thus you need to verify it by your own. Using min and max properties with this doesn't make any sense.
(specifying min, max, required and type properties are optional)
No comments:
Post a Comment