Monthly Archives: January 2014

HTML5 Datalist control

HTML5 Web Development

HTML5 Datalist control is more alike Google Suggest. Before HTML5 presence even for a known list to be suggested, developers go for AJAX request to hit on the database and populate the suggestion list. For every keystroke, an AJAX request is fired. HTML5 ‘Datalist’ could be useful when the form is to be loaded with known list. For example, a form has to be chosen with month. I will explain down with the code how it could be achieved through Datalist HTML5 control.

Code:

<!DOCTYPE html>
<html>
<head>
<title>HTML5 Datalist Demo</title>
</head>
<body>
<form action="LoginPageSuccess.jsp" method="get">
<input type="text" placeholder="Month Name" id="MonthText" list="getMonthList" required>
<datalist id="getMonthList">
<option value="January"/>
<option value="February"/>
<option value="March"/>
<option value="April"/>
<option value="May"/>
<option value="June"/>
<option value="July"/>
<option value="August"/>
<option value="September"/>
<option value="October"/>
<option value="November"/>
<option value="December"/>
</datalist>
</form>
</body>
</html>

 

Screenshot of how it works:

Image

View original post

Advertisements

Send attachments with email in PHP

My Blog

Add below function in your PHP file.

Use this function like,

View original post

MVC 4 – Using HTML5 “data-” attributes with Jquery

a developer's notes - a semi-technical web development BLOG

You can create data- HTML attributes with your controls using this technique.

Define a new HTML Attributes anonymous object with your Html helpers. Below, I create a text box with some additional properties I want to be able to access with jQuery. Using properties that start with “data_”, you will be able to access the property with jquery’s data() method. Note: using property names that start with “data-” will result in a compilation error.

This is the HTML that gets rendered

Here is what jquery’s data() method converts property names to. Interestingly, the underscores are removed and camel casing is applied to the name.

data-dash-watch

Here is another good article on the subject.
http://unmatchedstyle.com/news/html5-data-attributes-jquery.php

View original post

%d bloggers like this: