<html>
<head>
<title>Jquery Example</title>
</head>
<body>
<form id="page1_form" name="page1_form" method="post">
<h2>Send html attribute value from one page to another page using jquery</h2>
<input type="hidden" name="Id" value="-1" />
<input type="button" class="btnButton" name="btn" value='btn' id="5" >
</form>
</body>
</html>
<script>
$(document).ready(function() {
$("input.btnButton:button").click(function () {
ID = $(this).attr("id");
if (parseInt(ID) > 0) {
$("#page1_form input[name=Id]").val(ID);
$("#page1_form").attr("action", "page2.php");
$("#page1_form").submit();
}
});
});
</script>
<head>
<title>Jquery Example</title>
</head>
<body>
<form id="page1_form" name="page1_form" method="post">
<h2>Send html attribute value from one page to another page using jquery</h2>
<input type="hidden" name="Id" value="-1" />
<input type="button" class="btnButton" name="btn" value='btn' id="5" >
</form>
</body>
</html>
<script>
$(document).ready(function() {
$("input.btnButton:button").click(function () {
ID = $(this).attr("id");
if (parseInt(ID) > 0) {
$("#page1_form input[name=Id]").val(ID);
$("#page1_form").attr("action", "page2.php");
$("#page1_form").submit();
}
});
});
</script>
No comments:
Post a Comment