Dears, my case is like here:
In the form, I have 2 text box control, 2 hyperlink control and a drop down list.
The 2 hyperlink control is actually for pop-up a calendar window and user can select the date on the calendar to that 2 text boxes.(Use Javascript)
I wanna add a javascript to the submit button of the form which for open a window for a report.
The problem is, the textbox textchanged even is not actived by the javascript "editing". (I have already make the text box AutoPostBack=true, and I check that it works when I type the date in the textbox by myself)
CODE:
HTML:
If there are any thread which is good reference for me, please let me know. I have try some keyword search, but fail to get the solution. (or suggest some keyword please)
Thank you very much.
In the form, I have 2 text box control, 2 hyperlink control and a drop down list.
The 2 hyperlink control is actually for pop-up a calendar window and user can select the date on the calendar to that 2 text boxes.(Use Javascript)
I wanna add a javascript to the submit button of the form which for open a window for a report.
The problem is, the textbox textchanged even is not actived by the javascript "editing". (I have already make the text box AutoPostBack=true, and I check that it works when I type the date in the textbox by myself)
CODE:
Code:
<script runat="server">
Sub Page_Load
hlStartDate.NavigateUrl = "Javascript:pickDate('" & txtStartDate.ClientID & "')"
hlEndDate.NavigateUrl = "Javascript:pickDate('" & txtEndDate.ClientID & "')"
End Sub
Sub PortList_SelectedIndexChanged(sender As Object, e As EventArgs)
ButtonSend.Attributes.Add ("onClick", "javascript:window.open('generate_Report.asp?txtStartDate=" & txtStartDate.text & "&txtEndDate=" & txtEndDate.text & "&CountryList=" & CountryList.text & "')")
End Sub
Sub txtStartDate_TextChanged(sender As Object, e As EventArgs)
ButtonSend.Attributes.Add ("onClick", "javascript:window.open('generate_Report.asp?txtStartDate=" & txtStartDate.text & "&txtEndDate=" & txtEndDate.text & "&CountryList=" & CountryList.text & "')")
End Sub
Sub txtEndDate_TextChanged(sender As Object, e As EventArgs)
label1.text = "End Change"
ButtonSend.Attributes.Add ("onClick", "javascript:window.open('generate_Report.asp?txtStartDate=" & txtStartDate.text & "&txtEndDate=" & txtEndDate.text & "&CountryList=" & CountryList.text & "')")
End Sub
</script>
HTML:
Code:
<form id="form1" runat="server">
<tr>
<td class="ReportLabel" style="WIDTH: 100px">
<asp:Label id="lblStartDate" runat="server" cssclass="label">Start Date</asp:Label></td>
<td class="ReportField" colspan="2">
<asp:HyperLink id="hlStartDate" runat="server" ImageUrl="Images\date-picker.gif"></asp:HyperLink>
<asp:TextBox id="txtStartDate" runat="server" CssClass="textbox" AutoPostBack="True" OnTextChanged="txtStartDate_TextChanged"></asp:TextBox></td>
</tr>
<tr>
<td class="ReportLabel" style="WIDTH: 100px">
<asp:Label id="lblEndDate" runat="server" cssclass="label">End Date</asp:Label></td>
<td class="ReportField" colspan="2">
<asp:HyperLink id="hlEndDate" tabIndex="1" runat="server" ImageUrl="Images\date-picker.gif"></asp:HyperLink>
<asp:TextBox id="txtEndDate" runat="server" CssClass="textbox" AutoPostBack="True" OnTextChanged="txtEndDate_TextChanged"></asp:TextBox></td>
</tr>
<tr>
<td class="ReportLabel" style="WIDTH: 100px">
<asp:Label id="lblCountry" runat="server" cssclass="label">Country</asp:Label></td>
<td class="ReportField" colspan="2">
<asp:SqlDataSource id="CountryDataSource" Runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:connection1 %>" SelectCommand="SELECT * FROM [tblCountry]"></asp:SqlDataSource>
<asp:DropDownList id="CountryList" runat="server" CssClass="dropdownbox" DataSourceID="CountryDataSource" DataValueField="CountryCode" DataTextField="CountryName" AppendDataBoundItems="True" OnSelectedIndexChanged="CountryList_SelectedIndexChanged" AutoPostBack="True">
<asp:ListItem>All</asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr>
<td> </td>
<td colspan="2">
<asp:Button id="ButtonSend" runat="server" Text="Send"></asp:Button></td>
</tr>
If there are any thread which is good reference for me, please let me know. I have try some keyword search, but fail to get the solution. (or suggest some keyword please)
Thank you very much.