this shouldn't be too hard, but I want to have a textbox, and a button and when someone clicks that button, i want it to goto /files/(number in textbox).htm
how can I do this
thanks,
Dimava
Printable View
this shouldn't be too hard, but I want to have a textbox, and a button and when someone clicks that button, i want it to goto /files/(number in textbox).htm
how can I do this
thanks,
Dimava
Check to see if window.navigate() is part of the standards. If so, you can build the URL (myURL = "http://www.mydomain.com/mysite/files/" + document.myForm.myTextInput.Value + ".html";) and pass it on. Might want to validate the input first.
I have this:
what do I do next? (i dont have a form)Code:<input type="text" name="textfield2" size="5" maxlength="3">
<input type="submit" name="Download2" value="Download">
thanks
Dimava
Out of practice, I always put input elements in a form. But, I guess you don't have to. It just gets a little stickier when you want to reffer to the input element by ID.
Some key words to look up regarding HTML/DOM/JavaScript.
document.getElementByID()
the onClick attribute
window.navigate()
I coudln't really find anything that would help me out
First of all - enclose all elements like buttons,textboxes,textarea be enclosed in forms - otherwise I think it will not work in NetScape.
Code:<script language="javascript">
function CallPage(theform)
{
mstr = "/files/" + theform.textfield2.value + ".htm";
window.location.href = mstr;
}
</script>
<form name=myform>
<input type="text" name="textfield2" size="5" maxlength="3">
<input type="button" name="Download2" value="Download" onclick="CallPage(document.myform);">
</form>
Thats it.