D
Dave L
Could someone explain: I have a java popup window function that I would
like to pass a querystring ID from a hiddenfield on my asp.net content page.
The following code works. Note: for this test I simply set the hiddefield
var TransID.value = 21 in btnPopUp.click event See Item 1. The thing I
don't understand is why can't I have the function take the TransID as a
parameter. see Item 2.
**************Item 1.****************
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" >
function PopUp() {
var InqID = document.getElementById('<%=TransID.ClientID%>').value;
alert(InqID);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:Button ID="btnPopUp" runat="server" Text="Press Me"
OnClientClick="javascriptopUp();" />
<asp:HiddenField ID="TransID" runat="server" />
</asp:Content>
*************Item 2.****************
This Fails
***********************************
<script type="text/javascript" >
function PopUp(obj) {
var InqID = document.getElementById(obj).value;
alert(InqID);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:Button ID="btnPopUp" runat="server" Text="Press Me"
OnClientClick="javascriptopUp('<%=TransID.ClientID%>');" />
<asp:HiddenField ID="TransID" runat="server" />
</asp:Content>
Any help would be greatly appreaciated.
Feel free to email me at (e-mail address removed)
like to pass a querystring ID from a hiddenfield on my asp.net content page.
The following code works. Note: for this test I simply set the hiddefield
var TransID.value = 21 in btnPopUp.click event See Item 1. The thing I
don't understand is why can't I have the function take the TransID as a
parameter. see Item 2.
**************Item 1.****************
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript" >
function PopUp() {
var InqID = document.getElementById('<%=TransID.ClientID%>').value;
alert(InqID);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:Button ID="btnPopUp" runat="server" Text="Press Me"
OnClientClick="javascriptopUp();" />
<asp:HiddenField ID="TransID" runat="server" />
</asp:Content>
*************Item 2.****************
This Fails
***********************************
<script type="text/javascript" >
function PopUp(obj) {
var InqID = document.getElementById(obj).value;
alert(InqID);
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:Button ID="btnPopUp" runat="server" Text="Press Me"
OnClientClick="javascriptopUp('<%=TransID.ClientID%>');" />
<asp:HiddenField ID="TransID" runat="server" />
</asp:Content>
Any help would be greatly appreaciated.
Feel free to email me at (e-mail address removed)