PDA

View Full Version : Hyperlink selection to input box



Brian_C_C
09-21-2007, 03:29 AM
Is it possible to make a hyperlink fill out a value in a form?

I have a list of hyperlinks I want to automatically fill out the values in the text boxes on a form I've created when the user selects those hyperlinks.

djr33
09-21-2007, 04:18 AM
<a onClick="document.forms.myform.elements.mytextbox.value='myvalue'; return false;" href="#">

Brian_C_C
09-21-2007, 06:09 AM
I'm pretty weak in the forms / program world... can you ellaborate...

Here's the details. I have an html document called "dining.html" with an iframe pointing to an HTML document with list of restaurants in our town, that document is called "dining-list.html".

Also located right below that iframe in my "dining.html" page is a mapquest script for users to search addresses.

What I am trying to do is make it possible for users to select a restaurant listing link in the iframe referencing the "dining-list.html" file and have that hyperlink fill out the mapquest "get" form on the "dining.html" page. Then all they have to do is select submit.

Possible? I know their's probably easier ways to do this... it's a bit beyond me though... any advice would be nice...

Thanks!!!




<a onClick="document.forms.myform.elements.mytextbox.value='myvalue'; return false;" href="#">

Brian_C_C
09-21-2007, 06:11 PM
I got that to work... I couldn't figure it out using an html link in one document iframed into the document with the search... but I can rewrite my page to include the form with it....

Thanks!

Brian_C_C
09-21-2007, 08:39 PM
My link is located in an Iframe html document. Can I get that link to point to the document the iframe is in instead?

TimFA
09-21-2007, 09:43 PM
The easiest way would probably be to change the "document" element or add something to target the other. I'm not very experienced so I'm not sure what.


<a onClick="document.forms.myform.elements.mytextbox.value='myvalue'; return false;" href="#">

Brian_C_C
09-22-2007, 09:44 PM
I agree...

now if someone could tell me how to direct the hyperlink inside the .html document embedded using the iframe to the value of the text box on the .html document the iframe is located in, it would help tremendously!

djr33
09-22-2007, 10:24 PM
parent. or framename..

Brian_C_C
09-24-2007, 12:03 AM
That works!! Thank you! You're awesome!!!