goodk
asked on
I want to use the input button - How do I see the value on the form submit
this part is inside the form,
<input type="button" runat="server" id="t1id" value="how do you see this value if changed" />
<input type="button" runat="server" id="t2id" value="how do you see this value if changed" />
on call back,
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("id= " + HttpContext.Current.Reques t.Form["t1 id"]);
}
the above only work for the button I click - how do I see the value if I do not click it but click t2 button? REALIZE I AM NOT USING ASP buttons!!
<input type="button" runat="server" id="t1id" value="how do you see this value if changed" />
<input type="button" runat="server" id="t2id" value="how do you see this value if changed" />
on call back,
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("id= " + HttpContext.Current.Reques
}
the above only work for the button I click - how do I see the value if I do not click it but click t2 button? REALIZE I AM NOT USING ASP buttons!!
ASKER
Hi thanks,
in my case I show the dates on button and then on the client side two buttons acquire a new date through date picker.
When I click the submit button, I want to use those values.
. Please help
in my case I show the dates on button and then on the client side two buttons acquire a new date through date picker.
When I click the submit button, I want to use those values.
. Please help
ASKER
here is my code, there are no value appear when I do response.write
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Date= " + HttpContext.Current.Reques t.Form["t" ]);
}
</script>
<link href="../jquery/jquery-Cal endar.css" rel="stylesheet" type="text/css" />
<script src="../jquery/jquery-1.5. 2.js" type="text/javascript"></s cript>
<script src="../jquery/jquery-ui-1 .8.9.js" type="text/javascript"></s cript> <script type="text/javascript">
$(document).ready(function () {
$("#datepicker").datepicke r();
});
$(document).ready(function () {
$("#t").datepicker();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" name="t" runat="server" id="t" value="04/04/2011" onclick='$( "#t" ).datepicker( "show");' />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Date= " + HttpContext.Current.Reques
}
</script>
<link href="../jquery/jquery-Cal
<script src="../jquery/jquery-1.5.
<script src="../jquery/jquery-ui-1
$(document).ready(function
$("#datepicker").datepicke
});
$(document).ready(function
$("#t").datepicker();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="button" name="t" runat="server" id="t" value="04/04/2011" onclick='$( "#t" ).datepicker( "show");' />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
ASKER
I kind of figured out that I have to equate hidden fields to displayed button field, so I did the following.
I am facing a small problem though. when I use the master page, and the form is located in it. It is not working, that is it does not know form1?
How to resolve this?
function submitform() {
form1.hCal1.value = form1.Cal1.value;
form1.hCal2.value = form1.Cal2.value;
document.form1.submit();
}
I am facing a small problem though. when I use the master page, and the form is located in it. It is not working, that is it does not know form1?
How to resolve this?
function submitform() {
form1.hCal1.value = form1.Cal1.value;
form1.hCal2.value = form1.Cal2.value;
document.form1.submit();
}
ASKER
I HAD TO USE aspnetForm for the form name - WHAT THE HELL this asp.net is?????
even though the name of my form is form1 - Where are the experts??
ASKER
basically, I am asking how the form submit works when we are using the master pages
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanks, it works good!!
why take so long to responsd and help??
why take so long to responsd and help??
HTML button posts the values inside FORM tag except other buttons to identify which button is clicked.
But there is an alternative, you can use a input hidden field to store the value of a button.
e.g.
<input type='hidden' id='hdnB1' name='hdnB1' value='Button1 text' />
<input type='hidden' id='hdnB2' name='hdnB2' value='Button2 text' />