Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Div display issue

Status
Not open for further replies.

jbird80

IS-IT--Management
Oct 15, 2008
1
US
I have a hidden div that is to be hiden/shown using javascript immediately after a button is clicked then selected printer is installed using vbscript. everything works but in the wrong order i click vb_yes and the printer imediatly gets installed with out displaying the div. the div then will show after the printer has been installed. any sugestions?

//Code for button
<input language="vbscript" type="button" value="vb_yes" onclick="vbscript:Call Installprinter('4014','true')">

//function that runs when button is press
Function Installprinter(printer_name, default)
if installingdiv() = "true" then //java script function to show the installing div.
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection printer_name
If default = "true" Then
WshNetwork.SetDefaultPrinter printer_name
End If
end if
End Function


//Java script function
function installingdiv()
{
var setdefaultdiv = document.getElementById("installwnd_body_setdefault")
var installprinterdiv = document.getElementById("installwnd_body_install")

setdefaultdiv.style.display = "none";
installprinterdiv.style.display = "";
return "true";
}

any help will be much apreciated.

Thank you

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top