Problem in hiding a href using Javascript

C

c.verma

I am not able to hide a href element using javascript. Here is my code
written on aspx page.
On the click of "OK" button, I want to hide href element. But I am
getting message: Object required. Any ideas?

<asp:textbox id="txtWait" style="DISPLAY: none" runat="server"
Width="326px" BorderStyle="None" BorderColor="whitesmoke"
ForeColor="Red" ReadOnly="true" Font-Bold="True">Please wait while we
process your information...</asp:textbox><br>

<asp:Button ID="btnOK" Runat="server" ForeColor="White"
Font-Size="8pt" BorderColor="ActiveBorder" BackColor="#003366"
BorderStyle="Outset" BorderWidth="1px" Font-Names="Tahoma" Text="OK"
Height="19" Width="100"></asp:Button>
<input id="btnAttach" style="FONT-SIZE: 8pt; COLOR: white;
FONT-FAMILY: tahoma; BACKGROUND-COLOR: #003366" type="button"
value="Upload Attachments">
<A class="HelpText" style="DISPLAY: ;" id="txtAref"
onclick="showHide('uploadinfo')">(Attachment Info)</A>
<script language=javascript event=onclick
for="<%=btnOK.UniqueID %>" >
var hWnd =
window.showModalDialog("ConfirmInvoiceSubmit.aspx","Dialog Box
Arguments # 1","dialogHeight: 300px; dialogWidth: 410px; dialogTop:
300px; dialogLeft: 300px; edge: Raised; center: Yes; help: No;
resizable: No; status: No;");

if((hWnd == 1) || (hWnd == 2))
{
document.forms[0].item("hdnInvoiceSubmit").value = hWnd;
document.forms[0].item("btnOK").style.display = "none";
document.forms[0].item("btnAttach").style.display = "none";
//problem: document.forms[0].item("txtAref").style.display =
"none";

document.forms[0].item("txtWait").style.display = "";

return true;
}

if(hWnd == 3)
{
return false;
}
else
{
document.forms[0].item("btnOK").style.display = "";
document.forms[0].item("btnAttach").style.display = "";
document.forms[0].item("txtWait").style.display = "none";
return false;
}
</script>

<ASP:TEXTBOX id="hdnInvoiceSubmit" runat="server" Width="20"
Visible="true"></ASP:TEXTBOX>

Thanks
 
T

Thomas 'PointedEars' Lahn

I am not able to hide a href element using javascript. Here is my code
written on aspx page.
On the click of "OK" button, I want to hide href element. But I am
getting message: Object required. Any ideas?

<asp:textbox id="txtWait" style="DISPLAY: none" runat="server"
Width="326px" BorderStyle="None" BorderColor="whitesmoke"
ForeColor="Red" ReadOnly="true" Font-Bold="True">Please wait while we
process your information...</asp:textbox><br>
[loads of ugly *tab-indented* ASP code]

Your ASP code is irrelevant and unwanted here because the client-side script
that is used to hide the element has to operate on what is generated from
it. Have a look at that client-side code, debug it, and probably you will
see what is going wrong. If not, post the relevant parts of it (and indent
blocks with multiples of two spaces not the Tab character), or the public
URL of a stripped-down test case.

<URL:http://jibbering.com/faq/>


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top