1
I need JavaScript help!
How do I check the input from an <input> tag with javascript? I already have this much: (Anything with a ? present is something I need help with.)
How will I do this? Alslo, to be more specific, I want it to go to accountpass.joeminer.html if the input is "Joe_Miner".
<form action="?" method="get">
Username: <input type="text">
<input type="submit" value="Submit">
</form>
How will I do this? Alslo, to be more specific, I want it to go to accountpass.joeminer.html if the input is "Joe_Miner".
Create an account or sign in to comment.
7
1
HI!
1
Again, don't post if you can't help
Anyways, here's what you'll need (I recommend looking at javascript tutorials, because this is fairly basic stuff:
I don't know how you're handling the input or anything, but pass the string from the textbox into the test() function and do this:
var str = StringFromTextbox.toLowerCase();
str = str.replace('_', '');
window.location.href = str + ".html";
Anyways, here's what you'll need (I recommend looking at javascript tutorials, because this is fairly basic stuff:
I don't know how you're handling the input or anything, but pass the string from the textbox into the test() function and do this:
var str = StringFromTextbox.toLowerCase();
str = str.replace('_', '');
window.location.href = str + ".html";
1
Hello?
1
How will I do this? Alslo, to be more specific, I want it to go to accountpass.joeminer.html if the input is "Joe_Miner".
Can you help with that?
1
Hey Joe Miner!
I would love to help you but....
I'm more experienced with Java than Javascript.
Sorry.....
I would love to help you but....
I'm more experienced with Java than Javascript.
Sorry.....
1
Why did you post then?
Anyways, back on topic:
Should run the test() function when submit is pressed after entering text!
Anyways, back on topic:
<input type="text" id="userInput"=>give me input</input>
<button onclick="test()">Submit</button>
<script>
function test()
{
var userInput = document.getElementById("userInput").value;
document.write(userInput);
}
</script>
Should run the test() function when submit is pressed after entering text!
1
What's the difference?