Hi,
Are you sure the btn is there?
View the source of the page to see if its there
and if it is check for typos, JavaScript is case sensitive
if(document.forms["FORMNAME"].BTNNAME)
{
}
else alert("Btn not found");
Set the btn display/visibility:
style="display:none"....
or
style="visibility:hidden"
--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/ http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground:
http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"D" <an*******@discussions.microsoft.com> wrote in message
news:B5**********************************@microsof t.com...
Thanks for the reply.
I am doing what you said, but it gives a javascript error - btnTemp
(that's the name of the hidden button on my page for which I want to cause
the postback) is null or not an object.
This is my javascript
function ShowWindow(Message, Mode)
{
var RetVal = "";
var strPage = document.getElementById("pathfordialog").value +
"?DialogMessage=" + Message + "&DialogMode=" + Mode;
RetVal= window.showModalDialog(strPage ,"Alert","edge: Raised; center:
Yes; help: no; resizable: no; status: no; dialogWidth:750px;
dialogHeight:250px");
if (RetVal == '1')
{
document.forms["Form1"].btnTemp.click();
}
return;
}
btnTemp is a asp.net button control which is hidden.
I am returming values 0,1,2 etc from my modal dialog based on whether
buttons ok, yes, no etc are clicked on that page.