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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form to accept a url and create X tabs with that URL

Status
Not open for further replies.

cbsarge

IS-IT--Management
Jun 20, 2001
219
US
I'd like to create a form that accepts a URL pasted in by the user and then also creates an input number of tabs with that URL. I have a vbscript that does this but, thought it would be nice to have it in a webpage. Is this something a simple <form> is capable of or will something like javascript be required?

Thanks and I'm including the vbscript code for reference.

Code:
On Error Resume Next
Dim strProgram
Dim strNum
Dim strURL
Dim WshShell

MsgBox "message text", vbOKOnly, "title"
strProgram = "chrome.exe"
strNum = InputBox("Enter the number of tabs you would like to open.", "title")
strURL = InputBox("Enter the URL for your tabs.", "title")

If strNum = "" Then
MsgBox "You didn't enter a number for how many tabs to create." & VBNewLine & "The program will now end.", VBCritical, "title - ERROR"
WScript.Quit
End If

If strURL = "" Then
MsgBox "You didn't enter a URL." & VBNewLine & "The program will now end.", VBCritical, "title - ERROR"
WScript.Quit
End If

Set WshShell = WScript.CreateObject("WScript.Shell")
i = strNum
Do Until i=0
  i=i-1
  WshShell.Run strProgram & " " & strURL  
  WScript.Sleep(1000)
  If i<1 Then Exit Do
Loop

[!]The AutoSavers![/!] [2thumbsup]
 
HTML and by extension HTML Forms are static, they are only there for markup. They cannot perform complex tasks like the ones you describe. You are most definitely going to require Javascript to do it.

However, opening many windows or tabs is somewhat limited by most browsers and pop-up blockers these days to avoid browser spamming. So unless you can guarantee the pop-up blocker will not interfere it may not work right across the board.



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top