Online computer courses, code, programming tutorial and sidebar information for monitoring Canadian S&P/TSX index. Build friendship and networking. Welcome to visit my blogs often!!! I also have two other sites: YouTube Channel and Google site.
Adsense
Popular Posts
- PHPWind-- A PHP forum script applcaition in China
- How to blend adsense inside your post?
- Formatting my post
- Notepad++ - Add C++ compiler
- Install PHPMailer 5.2.4 and use smtp gmail
- Wayback Machine - see archived versions of web pages across time
- Set up a child account and set screen time limit in Windows 8
- phpexcel toggle expand and hide column in EXCEL and summary
- Install PHP ibm_db2 extension in Linux (redHat)
- PHP: add a download as pdf file button in report page
Thursday, March 7, 2013
Redirect a link using button
Below is the example to redirect a link using a button. We can also pass checkbox value to the link.
code:
<script type="text/javascript">
<!--
function redirectlink(){
vc1=document.form1.c1.value;
vc2=document.form1.c2.value;
vc3=document.form1.c3.value;
if (document.form1.c1.checked == false) vc1=0;
if (document.form1.c2.checked == false) vc2=0;
if (document.form1.c3.checked == false) vc3=0;
window.location = "http://jiansenlu.blogspot.com/?c1="+ vc1+"&c2="+vc2+"&c3="+vc3;
}
//-->
</script>
<form action="export.php" method="post" name="form1">
<button type='button' id="filter2" onclick="redirectlink()"> Redirect a link </button>
<input type="checkbox" id="c1" name="c1" value="1" />Pass c1
<input type="checkbox" id="c2" name="c2" value="1" />Pass c2
<input type="checkbox" id="c3" name="c3" value="1" />Pass C3
</form>
Demo:
Subscribe to:
Post Comments (Atom)
hello... can i use this to get the data from an input field and redirect to it on submit?
ReplyDelete