Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Get URL form user & display to page - Not Working.

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,316
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Get URL form user & display to page - Not Working.
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Get URL form user & display to page - Not Working. - 8/3/2001 3:57:58 AM   
  eak_guy

 

Posts: 15
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
I'm attempting to display a link to HTML page. Name of site will appear, address will be in code. Both items come from user input. The name appears on page and pretends to be a hot link, but when you click it - Nothing! Here's my code. I would much appreciate if you would point out my mistake?

<SCRIPT LANGUAGE="VBScript">
<!--
OPTION EXPLICIT
document.bgcolor="DBDB70"
document.write "<BR><CENTER><FONT SIZE=7 FACE=arial COLOR=brown><B><STRONG>Problem 12</STRONG></B></FONT></CENTER><BR><BR><BR><BR>"

Dim strURL
strURL=InputBox("Please enter the URL (Web address) of your favorite Website.")

Dim strName
strName=InputBox("What is the name of the Website?")

document.write "<BR><CENTER><FONT SIZE=5 FACE=arial COLOR=red><B><STRONG><A HREF=strURL>" & strName & "</A></STRONG></B></FONT></CENTER>"

//-->
</SCRIPT>
 
 
Post #: 1
 
 Re: Get URL form user & display to page - Not Working. - 8/3/2001 4:00:03 AM   
  compugenie

 

Posts: 9
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
You probably need to change the last document.write statement to this...

document.write "<BR><CENTER><FONT SIZE=5 FACE=arial COLOR=red><B><STRONG><A HREF='" & strURL & "'>" & strName & "</A></STRONG></B></FONT></CENTER>"


Notice the single quotes used to surround the url and the strURL outside of the document.write. Basically, the way it was would literally try to send you to strURL not http://www.whatever.com.

(in reply to eak_guy)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Get URL form user & display to page - Not Working. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts