Auto fill a text box in a form.

G

Guest

When a user clicks on a hyperlink it will open a form and the user will fill
in the information requested on the form. What I would like, is to have the
clicked hyperlink text autofill a text box in the form.

I am using fp2003.

Thanks
Charlie
 
T

Trevor L.

Charlie said:
When a user clicks on a hyperlink it will open a form and the user
will fill in the information requested on the form. What I would
like, is to have the clicked hyperlink text autofill a text box in
the form.

I am using fp2003.

Thanks
Charlie

Maybe I don't understand the question, but my response is to fill in the
value in the form
e.g.
Name:<br/>
<input type="text" name="Name" value="Insert name" size="40" >

The textbox Name will then have "Insert name" filled in.

Or are you saying that the text on the hyperlink is the text you want to go
into the textbox ?

Even that isn't difficult - just put the same text in both places.
 
G

Guest

It is the text on the hyperlink I want in the text box. There are serveral
hyperlinks that the user can click that links to the form, ie (A name of a
college) So if a user clicked on the hyperlink for Yale, Yale would appear in
the form text box, if Harvard is the hperlink then Harvard would apperar in
the form text box.
 
T

Trevor L.

Charlie said:
It is the text on the hyperlink I want in the text box. There are
serveral hyperlinks that the user can click that links to the form,
ie (A name of a college) So if a user clicked on the hyperlink for
Yale, Yale would appear in the form text box, if Harvard is the
hperlink then Harvard would apperar in the form text box.

O.K. Got it.

I thought this might be the case.

Let me think about it for a little while
 
T

Trevor L.

Charlie said:
It is the text on the hyperlink I want in the text box. There are
serveral hyperlinks that the user can click that links to the form,
ie (A name of a college) So if a user clicked on the hyperlink for
Yale, Yale would appear in the form text box, if Harvard is the
hperlink then Harvard would apperar in the form text box.
OK

Here it is.

The image in the calling html is just one I had on hand. Put whatever you
want in here.
The form may be a bit verbose, but it is a copy of another one I had put
together.
Nonetheless it works as you wanted

Calling code
=========
<html>
<head></head>
<body>
<a href="form.html?text=Yale" target="_blank">
<img src="images/display/hearts.gif" alt="" height="20" />
Yale</a>

<a href="form.html?text=Harvard" target="_blank">
<img src="images/display/hearts.gif" alt="" height="20" />
Harvard</a>
</body>
</html>

form.html
======
<html>
<!-- form.html -->
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null
}
function getname()
{ document.form1.Name.value = qsobj(0)}
</script>
</head>

<body onload="getname()">
<div align="center" >

<div style="border:1px solid #999999; width:60%;
background-color:#F2F4FA;">
<form name="form1" action="">

<div style="background-color:#DBE0F5; padding:3px; font:75% arial;">
<b>Form Heading</b>
</div>

<div style="padding:10px; font:75% Arial; text-align:left;">
<p>
Hi all,<br />
Intro. Text in here<br />

Name:<br/>
<input type="text" name="Name" value="Insert name" size="40"><br/>

<!-- more fields in here -->
</p>
</div>
</form>
</div>

</div>
</body>
</html>

Keep having fun
 
G

Guest

Thanks for the help, I'll let you know how I make out.

Charlie

Trevor L. said:
Charlie said:
It is the text on the hyperlink I want in the text box. There are
serveral hyperlinks that the user can click that links to the form,
ie (A name of a college) So if a user clicked on the hyperlink for
Yale, Yale would appear in the form text box, if Harvard is the
hperlink then Harvard would apperar in the form text box.
OK

Here it is.

The image in the calling html is just one I had on hand. Put whatever you
want in here.
The form may be a bit verbose, but it is a copy of another one I had put
together.
Nonetheless it works as you wanted

Calling code
=========
<html>
<head></head>
<body>
<a href="form.html?text=Yale" target="_blank">

Yale</a>

<a href="form.html?text=Harvard" target="_blank">

Harvard</a>
</body>
</html>

form.html
======
<html>
<!-- form.html -->
<head>
<script type="text/javascript">
function qsobj(parm)
{
var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null
}
function getname()
{ document.form1.Name.value = qsobj(0)}
</script>
</head>

<body onload="getname()">
<div align="center" >

<div style="border:1px solid #999999; width:60%;
background-color:#F2F4FA;">
<form name="form1" action="">

<div style="background-color:#DBE0F5; padding:3px; font:75% arial;">
<b>Form Heading</b>
</div>

<div style="padding:10px; font:75% Arial; text-align:left;">
<p>
Hi all,<br />
Intro. Text in here<br />

Name:<br/>
<input type="text" name="Name" value="Insert name" size="40"><br/>

<!-- more fields in here -->
</p>
</div>
</form>
</div>

</div>
</body>
</html>

Keep having fun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top