P
Phil
Hi,
There is a label and a textbox.
There are two buttons: one HTML (buttonA), the other ASP.NET (ButtonB).
Clicking on buttonA starts a javascript function, starting on ButtonB
triggers nothing but of course generates a postback.
Now my problem.
When clicking on buttonA, the text of the textbox and of the label are
modified by javascript, as expected.
When after that clicking on ButtonB, the only thing that happens is a
postback, so the original text of the label is back, but not as expected,
the original text of the textbox: it's still "textboxtext modified by
javascript".
Why?
Thanks
Phil
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Width="250px" Text="text
of textbox"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="text of
label"></asp:Label>
<input id="Button1" type="button" value="buttonA" onclick="client()"
/>
<asp:Button ID="Button2" runat="server" Text="ButtonB" />
</div>
</form>
</body>
<script type="text/javascript">
function client()
{
document.getElementById("TextBox1").value="textboxtext modified by
javascript"
document.getElementById("Label1").innerText="labeltekst modified by
javascript"
}
</script>
There is a label and a textbox.
There are two buttons: one HTML (buttonA), the other ASP.NET (ButtonB).
Clicking on buttonA starts a javascript function, starting on ButtonB
triggers nothing but of course generates a postback.
Now my problem.
When clicking on buttonA, the text of the textbox and of the label are
modified by javascript, as expected.
When after that clicking on ButtonB, the only thing that happens is a
postback, so the original text of the label is back, but not as expected,
the original text of the textbox: it's still "textboxtext modified by
javascript".
Why?
Thanks
Phil
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" Width="250px" Text="text
of textbox"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text="text of
label"></asp:Label>
<input id="Button1" type="button" value="buttonA" onclick="client()"
/>
<asp:Button ID="Button2" runat="server" Text="ButtonB" />
</div>
</form>
</body>
<script type="text/javascript">
function client()
{
document.getElementById("TextBox1").value="textboxtext modified by
javascript"
document.getElementById("Label1").innerText="labeltekst modified by
javascript"
}
</script>