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!

VBScript open new window

Status
Not open for further replies.

digiman1134

Programmer
Nov 23, 2004
19
US
I am trying to make a new window pop up in VBScript I am using a open (mid(confunction, 1, 180)) function could sombeody please tell me why it isn't popping up the window and paramaters I am naming in the confunction function it opens a new window, but not the one I am requesting, if this doesn't work could somebody please tell me a method to do this correctly
 
Hello digiman1134,

>I am using a open (mid(confunction, 1, 180)) function could sombeody please tell me why it isn't popping up the window and paramaters I am naming in the confunction function it opens a new window, but not the one I am requesting

What do you mean confunction??? What is it? Also, what is the host? (IE or wsh).

regards - tsuji
 
confunction is the variable I name in the script, it is passing along a URL, that is very long, and VBScript has trouble processing, I am using IE
 
digiman1134,

Vbscript engine can take _very_ long string without a problem per se. What is the open line you're using?

- tsuji
 
well, the variable that I have declared has 173 characters, but it also has three sets of quotation marks inside of it (") so if I put it right into the window.open function, it edits out what is in those quotations, and I really need those because they plug in values from a form I have on the web page that I need to pass along
 
digiman1134,

In that case, pass this the the url argument?
[tt]
escape(mid(confunction, 1, 180))
[/tt]
- tsuji
 
Further note:

Or possibly at the 1st argument of .open:
[tt]
<%=server.urlencode(mid(confunction, 1, 180))%>
[/tt]
if it is a server-side variable. Can't be 100% certain without firm idea of the environment.

- tsuji
 
well, I fixed that problem, but now I have another, the variables I am trying to pass along to the URL aren't working, any ideas, here is the complete script I'm using

<html>

<head>
<title>Batter Usage Totals JScript</title>



<script type="text/vbscript">
// Declare Global Variables
Dim StartReportDate
Dim EndReportDate
Dim ConStartDate
Dim ConEndDate
Dim Confunction
ConFunction = " Usage Report.rpt?init=actx&user0=****&password0=****&prompt0=Date(ConStartDate)&prompt1=Date(ConEndDate)"
StartDate = Calendar1
EndDate = Calendar2
ConStartDate = Startdate
ConEndDate = EndDate
Function GetReportButton_onclick()
open confunction



End Function
</script>
</head>

<body bgcolor="#c0c0c0">
<hr>
<font face="Verdana," size="2" Tahoma, Arial>



<hr>
<!-- Insert HTML here -->
<center>
<p style="BACKGROUND-COLOR: rgb(192,192,192)"><span
style="BACKGROUND-COLOR: rgb(192,192,192)"><font style="BACKGROUND-COLOR: silver"><big>Enter Report Start
Date Enter
Report</big> <big>End Date </big></font></span></p>

<p>
<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar1">
<param name="BackColor" value="-2147483633">
<param name="Year" value="<%=Year(Date())%>">
<param name="Month" value="<%=Month(Date())%>">
<param name="Day" value="<%=Day(Date())%>">
<param name="DayLength" value="1">
<param name="MonthLength" value="1">
<param name="DayFontColor" value="0">
<param name="FirstDay" value="7">
<param name="GridCellEffect" value="1">
<param name="GridFontColor" value="10485760">
<param name="GridLinesColor" value="-2147483632">
<param name="ShowDateSelectors" value="-1">
<param name="ShowDays" value="-1">
<param name="ShowHorizontalGrid" value="-1">
<param name="ShowTitle" value="-1">
<param name="ShowVerticalGrid" value="-1">
<param name="TitleFontColor" value="10485760">
<param name="ValueIsNull" value="0">
</object>

<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" id="Calendar2">
<param name="BackColor" value="-2147483633">
<param name="Year" value="<%=Year(Date())%>">
<param name="Month" value="<%=Month(Date())%>">
<param name="Day" value="<%=Day(Date())%>">
<param name="DayLength" value="1">
<param name="MonthLength" value="1">
<param name="DayFontColor" value="0">
<param name="FirstDay" value="7">
<param name="GridCellEffect" value="1">
<param name="GridFontColor" value="10485760">
<param name="GridLinesColor" value="-2147483632">
<param name="ShowDateSelectors" value="-1">
<param name="ShowDays" value="-1">
<param name="ShowHorizontalGrid" value="-1">
<param name="ShowTitle" value="-1">
<param name="ShowVerticalGrid" value="-1">
<param name="TitleFontColor" value="10485760">
<param name="ValueIsNull" value="0">
</object>




</p>

<p> </p>

<p> </p>

<p>
<input LANGUAGE="text/vbscript" onclick="id=GetReportButton" name= "GetReportButton" type= "button" value=" Get Report " onclick= "return GetReportButton_onclick()" tabIndex=2 style="HEIGHT: 41px; WIDTH: 128px">
</p></center>
</body>
</html>
 
digiman1134,

What is the original problem? I don't see the continuity. (I haven't look hard for long script-without a motivation.)

- tsuji
 
thank you, but I think i've figured it out, I just needed to move my function out of the head and into the body at the end, and then use Calendar.day, calendar.month, and claendar.year as the values
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top