FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

HTML Buttons to submit text to a url

 


The-Master
Sorry but this is difficult to explain.

I want a textbox and a submit button and when the submit button is clicked the site changes to the url ' + this.value+ ' from the textbox.

I can't quite work this one out.

Thanks Very Happy
Cibes
I don't really understand what you would need that for, the user can enter any text? Then there is a high probability that the new url does not exist!
If I understood you right and you want to do it anyway I think you'll have to do it with javascript:

for the button:
Code:
onClick="change()"

give your textbox
Code:
id="textbox"

and a script in the head of your file:
Code:
<script type="text/javascript">
function change() {
   var text = document.getElementById("textbox").value;
   var url = document.URL;
   document.URL = url+text
}
</script>


sorry I don't have time to test it, just hope it works Wink
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.