www.4cnotes.info

visit xdeem.com also

4cnotes.info

4cnotes.info for Free College Notes, Placement trainng

visit www.xdeem.com also

Thanks for ure visit

Thanks for visiting our site

visit xdeem.com also.

4cnotes.info

Thank u

Showing posts with label Java Script. Show all posts
Showing posts with label Java Script. Show all posts

More then one Submit Button in Form


The following form having two submit button with two different form action




<form name="main_form" action="main.php" method="get">
<input name="one" value="text box value.">
<input type="submit" name="submit" value="first_submit" onClick="document.main_form.action='first_action.php';">
<input type="submit" name="submit" value="second_submit" onClick="document.main_form.action='second_action.php';">
<input type="submit" name="submit" value="main_submit">
</form



Textbox Auto Clear Javascript/Html


The following code is very easy code for auto clear Textbox when it focus.


First Method:
<input name="email" type="text"  class="newsform" id="email" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Enter Email To Get Updates':this.value;" value="Enter Email To Get Updates" size="28"/>


Second Method:


<input type="text"  class="login-inp" value="User Name"  onfocus="this.value=''" name="uname" />



Msg/Alert box in PHP using Java Script

Normal Alert:
 
echo "<script>alert(\"Verify User Name or Password or Login Type\");</script>";

Dynamic Alert:

 
<script language="javascript">
 alert("<?php echo "$comp_name1"; ?>")
</script>

How Redirect to anothe page with PHP variable using Javascript Code:

Ordinary Javascript Redirect:
 
<script>
window.location.href="customer.php";
</script>


Redirect With Query String that means URL containg PHP varibale value:

<script>
window.location.href="customer.php?customerid=<?php echo $guid;?>";
</script>

Back Button in Java script

In Javascript, There are two ways to move back from your current page:

1. <a href="javascript: history.go(-1)">Go Back</a><br />

2. <script type="text/javascript"> javascript:history.back() </script>