Blogger Plug 'n' Play
NOTICE
Adfly Links not working Find Direct Links HERE
Detach() jQuery example
Following code showing examples of:
Learn more »
1) Detach() jQuery
2) How to same multiple Detach() from same classes on page and save detached content in an array.
3) Displaying detached content in a div on clicking respective "See More" text.
4) Using :gt which is used to detach all li's greater then index 4.
5) How to use check boxes as a component which can be used multiple times in a page with simple copy/paste without any change in JS code or classes name or anything.
How to build long forms using php in a short cut way
We can build a long form using php's foreach function in the following way.
It makes the form more manageable and clean
<form name="myform" method="get" action="business.php" onsubmit="">
<?php
$postvalue=array("Name"=>"0","Email"=>"1","Phone"=>"2");
foreach($postvalue as $key => $value)
{
echo ''.$key.'<input type="text" id="id'.$value.'" name="name['.$value.']" value=""><div id="err'.$value.'"></div><br>';
}
?>
<input type="submit" onclick="checkValidit()">
</form>
We can add any number of keys and values in array
To get the values we can use following code
<?php
session_start();
$value = $_GET["name"];
foreach ($value as $uni) {
$_SESSION[$uni] = $uni;
}
foreach ($value as $uni) {
echo $_SESSION[$uni] . "<br>";
}
?>
Learn more »
jQuery Form Validation Email and Phone Number
HTML FORM
<form name="myform" method="get" action="business.php" onsubmit=""> Name<input type="text" id="id0" name="name[0]" value=""><div id="err0"></div><br>Email<input type="text" id="id1" name="name[1]" value=""><div id="err1"></div><br>Phone<input type="text" id="id2" name="name[2]" value=""><div id="err2"></div><br><input type="submit" onclick="checkValidit()"> </form>jQuery Validation Code
<script type="text/javascript">
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^([w-.]+@([w-]+.)+[w-]{2,4})?$/);
return pattern.test(emailAddress);
};
function isValidPhone(phone) {
var pattern = new RegExp( /^d*[0-9](|.d*[0-9]|,d*[0-9])?$/);
return pattern.test(phone);
};
function checkValidit()
{
if( !$("input").val() ) {
$("form").submit(function (e) {
e.preventDefault(); //prevent default form submit
});
}
};
$(function(){
$('input').blur(function()
{
if($(this).attr("id")=="id1")
{
// alert("email");
if( !isValidEmailAddress($(this).val()) )
{
$("#err1").html("Enter Valid Mail");
}else if(!$(this).val()){
$("#err1").html("Enter Mail");
}
else{
$("#err1").html("");
}
}
else if($(this).attr("id")=="id2")
{
if( !isValidPhone($(this).val()) )
{
$("#err2").html("Enter Valid Phone");
}else if(!$(this).val()){
$("#err1").html("Enter Phone");
}
else{
$("#err2").html("");
}
}
else if($(this).attr("id")=="id0")
{
if( !$(this).val() )
{
$("#err0").html("Enter Name");
}
else{
$("#err0").html("");
}
}
});
});
</script>
Learn more »
Check Net balance in Reliance 3G Datacard
send MBAL to 55333 (toll free)
Learn more »
Free Web Hosting Websites with your own domains with 99% Uptime
Learn more »
PhpMyAdmin default password
go to file
Learn more »
C:\wamp\www\phpMyAdmin-4.0.1-all-languages\libraries\config.default.php
Search $cfg['Servers'][$i]['AllowNoPassword'] = false;
and change it to "true"
Form Validation Using jQuery and Showing A single Alert for Validation
In This Form We are Using Following Form Elements:
Learn more »
Input Text
Radio
Check
Select
Get Multiple Url Parameters with Same Name Using PHP
index.php?paraname=VALUE1¶name=VALUE2¶name=VALUE3¶name=VALUE4Now if we get paraname parameter as follow $val = $_REQUEST['paraname']; // Output only last value VALUE4 we can bind all parameters in an array by doing a change in the form from where the values are coming like as follow
<form action="" method="get"> <input name="paraname[]"> <input name="paraname[]"> <input name="paraname[]"> <input name="paraname[]"> </form>Then we can request the values as
<php
$val = $_REQUEST['paraname'];
foreach ($val as &$Mvalue) {
echo $Mvalue."<br>";
}
?>
Learn more »
How to disable warnings and notices in php.ini and WAMP
open php.ini Search "error_reporting = E_ALL" and Replace it with "error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING" .After saving restart the WAMP
Learn more »
Subscribe to:
Posts
(
Atom
)
Copyright © 2013 Blogger Plug n Play - jQuery Tools and Widgets and Blogger Templates

![[Image]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOYV3gv2z4Y2XHaKgtaFQqtp8tQv8N9WDq9vSgnPjxQV3RWVqWlBLKZ8fm-_wAsydesMGMbIiDOC7CPM7bHnLzMykSvKLJCw12wERb4X9N4ac4sNCYbHRS38NrLgh8QixaTfBBh33QUiU/s320/twitter.png)
![[Image]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq_Y6UTTOpjBjTOFD3F0HzGDazYEZYt6mcqV1V3Fu83F3hoLSMNccvVSA091xFd12pCuDunhlcLRORLY-0p87cnOEEo5lhT6E_V1nSkgd3NFNFd4CXnb904fFTnrT3sQOk280NTgeT2PM/s320/stumbleupon.png)
![[Image]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8-PRVD0_ilfe1o7yINUflbvhi3Zi-E_3nymhb91F8asEbbgM9LLIrHKl_ek8zYN-rIC5xDe88eSd5X84n9nX4k-KSZnAel_kyjC3_M8x8nvh9kSWuCem_SGIilF80G-RAF_5c_XveFRI/s320/facebook.png)
![[Image]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgASqt4SJgdYSu9j-GliS5rs5WiJQTT3QVujwA5cPS7fFh3zlIm3Tbyv_4PwVVkwzUDgfUybNAk07qVbKlcVFhXSe0VJYN1MQt3YgZhN4cbq-dYAqpYuW3fG1bBGaqIS3i11N59pC42CA/s320/rss.png)
![[Image]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxeLbuHpJcy2CM_w-PT7NrP6qvGGwOKCwVC4f-m3oo6ZemZpxxCEwcYPmJDTgoD5vEXu1oHcImR1hFWnKn02fBdNjWYiRAD9T8W9L17LpyIVTvrxhZZhK-Sql9Klk1mK3XtaUWj5h6OAQ/s320/technorati.png)