Web Development Information [PHP, DRUPAL, MYSQL, MAGENTO, JQUERY, JAVASCRIPT, CSS, HTML5]
Monday, May 14, 2012
HTML5 Range Control
This is the another input type introduced in HTML5 control is range. Its acting like volume or percentage. Your can drag the point and set the value.
0<input type="range" name="percentage" value="0" oninput="x.value=parseInt(percentage.value)" /><output name="x">0</output>
HTML5 Input Controls: Advanced Controls
Date list option in HTML5. Its used for auto complete text field. Your values given in datalist tag. These values are linked with list="browsers"
Browser: <input name="browsers" list="browsers" required="required" />
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
Browser: <input name="browsers" list="browsers" required="required" />
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
HTML5 Input Controls
<form method="post">
Email: <input type="email" name="email" value="" required="required">
URL: <input type="url" name="url" value="" required="required">
Telephone: <input type="tel" name="tel" value="" required="required">
<input type="submit" value="Submit" />
</form>
The above controls are introduced in HTML5 input controls. If we omit required attributes, it may be empty. Validation also will happen while submit a form.
Thursday, April 5, 2012
CASE WHEN option in MySQL
MySQL will return conditional based values without using if condition. Without using if conditions, we can use CASE WHEN option in MySQL.
For example,
For example,
For example: table name: students
sno | name | mark |
---|---|---|
1 | Sachin | 39 |
2 | Dravid | 90 |
3 | Kohli | 30 |
4 | Ganguly | 66 |
Output: Pass mark is above 40
sno | name | result |
---|---|---|
1 | Sachin | Fail |
2 | Sachin | Pass |
3 | Kohli | Fail |
4 | Ganguly | Pass |
Query:
SELECT sno, name, CASE WHEN mark >= 40 THEN 'Pass' ELSE 'Fail' END AS Result FROM student
Wednesday, March 28, 2012
Pass the form values from one domain to another domain with POST values.
yes. we can pass the form values from one domain to another domain with using POST method. We have to add action attribute in <form> tag.
<form method="POST" action="http://www.anotherdomain.com" target="_parent">
</form>
Subscribe to:
Posts (Atom)