M3mph15
asked on
Javascript error
Hi all,
I have a page with a gridview on it that shows some search results. Below the gridview is a radio button list for the print options and a button. What i want to do is print the gridview but without the radiobuttonlsit and the button.
What i have done is put a Literal Control in the head section of the page and on the click of the button i set the text of the literal control with a javascript statement.
LitJs.Text = "<script type=""text/javascript"">" & _
"var tbl = document.getElementById('< %=tblPrint .ClientID %>');" & _
"tbl.style.visibility = ""hidden"";" & _
"window.print();" & _
"tbl.style.visibility = ""visible"";" & _
"<" & _
"/" & "script>"
I have the radio button list and the button in a html table called tblPrint (see attached code). So i am trying to hide the table, print the page and then show the table.
Now when i click the button it stops on the line tbl.style.visibility = "hidden"; and gives the error "Microsoft JScript runtime error: Object required"
Thanks in advance
-M3mph15
I have a page with a gridview on it that shows some search results. Below the gridview is a radio button list for the print options and a button. What i want to do is print the gridview but without the radiobuttonlsit and the button.
What i have done is put a Literal Control in the head section of the page and on the click of the button i set the text of the literal control with a javascript statement.
LitJs.Text = "<script type=""text/javascript"">"
"var tbl = document.getElementById('<
"tbl.style.visibility = ""hidden"";" & _
"window.print();" & _
"tbl.style.visibility = ""visible"";" & _
"<" & _
"/" & "script>"
I have the radio button list and the button in a html table called tblPrint (see attached code). So i am trying to hide the table, print the page and then show the table.
Now when i click the button it stops on the line tbl.style.visibility = "hidden"; and gives the error "Microsoft JScript runtime error: Object required"
Thanks in advance
-M3mph15
<table style="width: 100%;" runat="server" id="tblPrint" >
<tr>
<td class="style1">
</td>
<td class="style2">
<asp:RadioButtonList ID="rblPrint" runat="server" Font-Names="Arial"
Font-Size="Small" Width="160px" Height="70px">
<asp:ListItem>Print List</asp:ListItem>
<asp:ListItem>Print Details</asp:ListItem>
<asp:ListItem Value="Print Address Label">Print Address Label</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<asp:Button ID="btnPrint" runat="server" Text="Print" Font-Names="Arial" />
</td>
</tr>
</table>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome.
ASKER