Showing posts with label HTML5. Show all posts
Showing posts with label HTML5. Show all posts

Wednesday, January 21, 2015

Wednesday, July 24, 2013

HTML5: Prevent browser form autofill

You hace to use autocomplete="off" in your form tag:

<form name="form1" id="form1" method="post" autocomplete="off"
      action="http://www.example.com/form.cgi">
      Name: <input type="text" name="text1" /><br/>
      Address: <input type="text" name="text2" /><br/>
      Phone: <input type="text" name="text3" /><br/>
      Password: <input type="password" name="password" /><br/>
     <input type="Submit" name="Submit" value="Submit" />
</form>

Reference:
https://developer.mozilla.org/en-US/docs/Mozilla/How_to_Turn_Off_Form_Autocompletion

Thursday, May 30, 2013

HTML5: Custom attributes

Use data- attribute. The format is "data-*", where "*" is replaced with the desired custom attribute name, then set to the desired string value. For example:

<div id="mydiv" data-brand="toyota" data-model="prius">
   John is very happy with his Toyota Prius, because he saves on gas.
</div>

Reference:
http://www.javascriptkit.com/dhtmltutors/customattributes.shtml

Monday, May 20, 2013

Thursday, May 16, 2013

Jquery: get selected item value of a dropdown - combobox element in jQuery

Use $('#{Id} :selected')

var selectedItem = $('#dropDownId :selected') // selected item object
var selectedItemText = $('#dropDownId :selected').text(); // selection text
var selectedItemId = $('#dropDownId :selected').attr('id'); // selection id

Reference:
http://stackoverflow.com/questions/2780566/to-get-selected-value-of-a-dropdown-select-element-in-jquery

Tuesday, May 14, 2013

HTML5: select tag placeholder

Use the disabled selected property:


<select>
    <option value="" disabled selected>Select your option</option>
    <option value="hurr">Durr</option>
</select>

Reference:
http://stackoverflow.com/questions/5805059/select-placeholder

Wednesday, October 31, 2012

HTML5 : input date referred types not supported on almost all browsers

Be careful, most of the date referred types like date,datetime,time,month,week are not currently supported by Chrome or FF or IE,

http://www.quirksmode.org/html5/inputs.html

HTML5: show hint when input type text is empty

Use placeholder attribute:

<input type = "text" name="text" placeholder="Email Address">

Reference:
http://stackoverflow.com/questions/108207/how-do-i-make-an-html-text-box-show-a-hint-when-empty