Hello. I admit that I don't know much about javascript. I'm pretty much relegated to only using html in webdesign. But I'm trying to do something and I think I may be close with dynamicurl in JS.
I found the following online tonight.
---------------
-------------------------------
When I put this into an html page, it pops up a small text box where the user can type in anything they want and click the "click here" button. When they do, they are linked from their current location to a folder named just what they typed.
For instance, if they type the word "javascript " into the text box and click the button, they are taken to
http://www.domain.com/javascript
Man, this is sooo close to what I need. I need something that does the same thing, but I'm wondering if there's any way to append something to the beginning and end of the text that was typed in. I want to take them to a particular picture instead of a folder. Using the text "javascript " as an example, I would want the dynamically generated url to be:
http://www.domain.com/bottom-javascript.jpg
So I'm basically adding "bottom-" (with the hyphen) BEFORE the text that was typed in, and then adding the ".jpg" at the end.
Is this something that could be done?
I'm guessing that this line:
location.href = document.form1. test.value;
Is the line that builds the link, but I'm afraid my knowledge of js is, well, I don't have any really......
If anyone in here knows the answer though, I'd be eternally grateful if you could shed some light.
Thanks
Beau
I found the following online tonight.
---------------
Code:
<html> <head> <script> function dynamicurl() { location.href = document.form1.test.value; } </script> </head> <body> <form name="form1"> <input type="text" name="test"> <a href="#" onClick="dynamicurl();">Click Here</a> </form> </body> </html>
When I put this into an html page, it pops up a small text box where the user can type in anything they want and click the "click here" button. When they do, they are linked from their current location to a folder named just what they typed.
For instance, if they type the word "javascript " into the text box and click the button, they are taken to
http://www.domain.com/javascript
Man, this is sooo close to what I need. I need something that does the same thing, but I'm wondering if there's any way to append something to the beginning and end of the text that was typed in. I want to take them to a particular picture instead of a folder. Using the text "javascript " as an example, I would want the dynamically generated url to be:
http://www.domain.com/bottom-javascript.jpg
So I'm basically adding "bottom-" (with the hyphen) BEFORE the text that was typed in, and then adding the ".jpg" at the end.
Is this something that could be done?
I'm guessing that this line:
location.href = document.form1. test.value;
Is the line that builds the link, but I'm afraid my knowledge of js is, well, I don't have any really......
If anyone in here knows the answer though, I'd be eternally grateful if you could shed some light.
Thanks
Beau
Comment