Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link Help 1

Status
Not open for further replies.

jessedh

MIS
Apr 16, 2002
96
US
I want to make a link that takes information from 2 text boxes and appends it to a link...I have no clue how to do this, but I figure it is pretty easy...any help?

 
no prob.

I want to put 2 text boxes on a web page where a user enters a county code and a state code. They then click a button and in two frames below, links open to

and

with the new state and county code appended so that the user can get the info w/o using their front-end.

I assume a little javascript could do it, but I really don't know it at all....

Thanks!
Jesse
 
<html>
<head>
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
<!--
function appendlink(link, one, two) {
link += one;
link += two;
alert(link);
}
-->
</script>
</head>
<body>
<form action=&quot;javascript:appendlink('http:\\\\somelink.com\\', document.forms[0].elements[0].value, document.forms[0].elements[1].value)&quot;>
<input type=&quot;text&quot;><br>
<input type=&quot;text&quot;><br>
<input type=&quot;submit&quot;><br>
</form>
</body>
</html> ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
did see the last 2 post ...but
the last script should be easy to modify to fit your needs
hope this helps ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Ok...

I see a potential problem here if you are hosted on a unix server.

Depending on how the user enters the details, the server will look for different files so you need to make all input to lowercase so that no matter how they enter it, the files will always be correct.

Jusr add this to the input boxes.
Code:
onChange=&quot;javascript:this.value=this.value.toLowerCase();&quot;

Hope this helps Wullie

 
<html>
<head>
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot;>
<!--
function appendlink(link, one, two) {
link += &quot;state=&quot;;
link += one;
link += &quot;country=&quot;;
link += two;
alert(link);
}
-->
</script>
</head>
<body>
<form action=&quot;javascript:appendlink(' document.forms[0].elements[0].value, document.forms[0].elements[1].value)&quot;>
state num :<input type=&quot;text&quot;><br>
country num : <input type=&quot;text&quot;><br>
<input type=&quot;submit&quot;><br>
</form>
</body>
</html> ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
framename.location = &quot;link.html&quot;; ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
i mean

function appendlink(link, one, two) {
link += &quot;state=&quot;;
link += one;
link += &quot;country=&quot;;
link += two;
framename.location = link;
} ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top