1

I am trying to do some client side validations and when I am adding the required attribute to my HTML inputs but it works only for some fields.

<input type = "text" name="description" id = "descriptionOfChange" required> //this works
<input type = "text" name = "cid" id = "cid" required> //this does not work(also is my primary key. Not sure if that is the reason why)
<input type="text" name = "dateOfCompletion" id="datepicker" required /> //this works too
sidds224
  • 167
  • 1
  • 1
  • 6

1 Answers1

0

It should work fine as it is, but just to make sure, try this:

<input type = "text" name = "description" id = "descriptionOfChange" required /> 
<input type = "text" name = "cid" id = "cid_css" required /> 
<input type = "text" name = "dateOfCompletion" id = "datepicker" required />

Although, semiclosing this tag is not necessary, it can make some browsers behave in a weird way, especially IE.

  • 1
    Yup that worked. I believe it was just consistently closing input tags. Will keep that in mind next time. Thanks:) – sidds224 Jul 08 '14 at 14:20