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
- PHP: add a download as pdf file button in report page
- Notepad++ - Add C++ compiler
- PHP connect IBM db2 database in XAMPP
- Datatable export excel wraptext and newline
- phpexcel toggle expand and hide column in EXCEL and summary
- Sweet Alert JS library - beautiful replacement of JavaScript Alert
- ActionScript 3.0 demo: create a falling snow in flash CS6
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