Using variables as links

Results 1 to 2 of 2

Thread: Using variables as links

  1. #1
    Neo Guest

    Default Using variables as links

    I need help to make an input box. It needs to save the text in a variable so that I can link it to another page. For example, if someone wanted to go to they would type it in my text box and click a button and the page would appear in another frame. Please send me the code for it because I cant work out how to do it. Either send it to my e-mail address or just post it on this forum. <BR><BR>Thanks <BR><BR>NEO <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Using variables as links

    NEO,<BR><BR>Below I&#039;ve prepared a simple html page that demonstrates how to changes the URL of the current document with javascript. I notice that you mentioned that you are using frames, so I&#039;d recommend that you also read this article:<BR><BR><BR><BR>************************ ***********************************<BR><BR>&lt;htm l&#062;&lt;body&#062;<BR><BR>&lt;script type="text/javascript" language="javascript"&#062;<BR>function frmHandler(str)<BR>{<BR> document.location.href = str.txtURL.value ;<BR> return false ;<BR>}<BR>&lt;/script&#062;<BR><BR>&lt;form name="frm1" onSubmit="return frmHandler(this);"&#062;<BR><BR>&lt;label&#062;Ent er a URL&lt;/label&#062;<BR>&nbsp;&nbsp;<BR>&lt;input type="text" name="txtURL" value="" /&#062;<BR><BR>&lt;br /&#062;<BR><BR>&lt;input type="submit" name="cmdSubmit" value="Go to URL..." /&#062;<BR><BR>&lt;/form&#062;<BR><BR>&lt;/body&#062;&lt;/html&#062;<BR><BR><BR>HTH<BR><BR>Darren<BR>[ ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts