kikuckable
kikuckable

Reputation: 29

Required field HTML5 form

I just created html 5 form with attribute "required".

Why it still appear popup "Please fill out this field" in left top of my browser(Firefox), not under the field when it submitted although all field filled.

here my code :

<form method="get" id="form_reg_mem">
                        <input type="hidden" name="s" value="member"/>
                        <input type="hidden" name="a" value="4"/>
                        <h5>member Informatio</h5>
                        <hr/><br/>
                        <p>
                            <label>Email</label>
                            <input id="mem_email" class="easyui-validatebox filter_email" type="email" name="mem_email" required style="width: 200px" maxlength="45" />
                        </p>
                        <p>
                            <label>First Name</label>
                            <input id="mem_fname" class="easyui-validatebox filter_alphanumeric" type="text" name="mem_fname" required style="width: 200px" maxlength="45"/>
                        </p>
                        <p>
                            <label>Last Name</label>
                            <input id="mem_lname" class="easyui-validatebox filter_alphanumeric" type="text" name="mem_lname" required style="width: 200px"  maxlength="45" />
                        </p>
                        <p>
                            <label>Address</label>
                            <textarea id="mem_addr" class="easyui-validatebox filter_alphanumeric" name="mem_addr" style="width: 400px" maxlength="128"></textarea>
                        </p>
                        <p>
                            <label>Phone</label>
                            <input id="mem_phone" class="easyui-validatebox filter_numeric" type="text" name="mem_phone" style="width: 150px" maxlength="32" required/>
                        <p>                               
                            <label>Member Class</label>
                            <input id="mem_class" name="mem_class" url="/mobmarket/json/class.json" valueField="id" textField="text">  
                            </input>
                        </p>
                        <p>
                            <input class="button" value="Register" type="submit"/>
                        </p>
                     </form>

Thx

Upvotes: 0

Views: 3293

Answers (3)

Guilherme Melo
Guilherme Melo

Reputation: 494

The answer provided by mbuurman is correct. Adding required="required" atribute to the input and select tags it worked ok for me. Tested on Chrome (30.0) and Firefox (24.0).

Upvotes: 0

kikuckable
kikuckable

Reputation: 29

Finally i know what my trouble. It because i use the "easy ui combo box element" as a required field Dont add required attribut if you use it

You must use this code to make it required

 $("some selector").combobox({
                required:true
            });

Upvotes: 2

mbuurman
mbuurman

Reputation: 86

The attribute should be

required="required"

Upvotes: 1

Related Questions