[Javascript] Dynamically generate link from text being typed in textbox?

David Yee dyee at AMSResponse.com
Thu Jan 17 17:15:57 CST 2002


You're correct Anthony.  One problem I didn't foresee before I asked the
question was the reloading of data already typed into the other boxes once
the link is clicked.  So basically the link would need to contain ALL the
data from the other fields on the form.  So I think I'll have to do it the
hard way- have two separate forms with two submit buttons.  One button will
POST to the same page (a PHP script) and write a bunch of hidden inputs
while the other button will POST to the other PHP script.

I would still be interested in a dynamic href builder example if anyone has
one.  Thanks!

David

> -----Original Message-----
> From: Anthony E. [mailto:apwebdesign at yahoo.com]
> Sent: Thursday, January 17, 2002 3:08 PM
> To: javascript at LaTech.edu
> Subject: Re: [Javascript] Dynamically generate link from text being
> typed in textbox?
> 
> 
> I may be wrong, but my impression was that he wanted
> to dynamically change the 'href' attribute of a link
> on the same page as a form (the value for the dynamic
> 'href' coming from an input field text box in a
> form)...all without reloading the page.
> 
> -Anthony E.
> 
> 
> 
> --- Hassan Schroeder <hassan at webtuitive.com> wrote:
> > David Yee wrote:
> > > 
> > > Hi all.  I'm wondering is it possible to
> > dynamically generate a link as text
> > > is being typed into a particular text box. 
> > Basically I want the link to
> > > contain a GET variable name and value without
> > submitting the form (the form
> > > actually posts to another page).  
> > 
> > So someone can either submit the form *or* click on
> > the link to go
> > to that page?
> > 
> > Something like this will work on NS4, NS6, IE5:
> > 
> > <script type="text/javascript">
> > 
> > 	var foo = "http://some.default.url/";
> > 
> > 	function qOpen()
> > 	{
> > 		window.location = foo;
> > 	}	
> > 
> > </script>
> > 
> > <a href="javascript://;" onclick="qOpen();return
> > false;">a link</a>
> > 
> > <form method="post" action="/whatever/process.cgi">
> > 
> > 	<input type="text" onblur="foo=this.value;" />
> > 	<input type="submit" value=" submit " />
> > </form>
> > 
> > HTH!
> > -- 
> > H*
> > Hassan Schroeder -----------------------------
> > hassan at webtuitive.com 
> > Webtuitive Design ===  (+1) 408-938-0567   ===
> > http://webtuitive.com
> > 
> >     -- creating dynamic Web sites and applications
> > since 1994 --
> > _______________________________________________
> > Javascript mailing list
> > Javascript at LaTech.edu
> > https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> =====
> --
> Anthony Ettinger
> apwebdesign at yahoo.com
> 415-504-8048
> http://chovy.com/resume.doc
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 



More information about the Javascript mailing list