hello everyone reading this!
I have made a simple script to change a link depending on some information a user answers. The script i have mad works only halfway. I have found i can make it work with a prompt box bu thats not really what i want.
Heres the script
[quote]
<head>
<form method=”get” id=”input1″ name=”input1″>
<input type=’text’ name=”input2″ id=”input2″ title=”input your gamertag”/>
<button type=”submit” onclick=”writelink()”>GO</button></form>
<title>Untitled</title>
</head>
<body>
<script>
var dayarray=(“
var text = (input1.elements[‘input2’].value)
function writelink(){
document.write(‘<a href=’);
document.write(”+dayarray+””+text+”);
document.write(‘>View My Stats</a><br>’);
document.write(“”+dayarray+””+text+””);
}
</script>
Try the script! it works but doesnt add the +text+ variable at the end of the link. it works if io change the
var text = (input1.elements[‘input2’].value)
to a prompt box
var text = prompt(type information here)
but i dont really want a prompt box.
I know this can be done but im a bit confsed, i think my var text = (input1.elements[‘input2’].value) is dodgy, but i don’t have enough knowldge of javascript to do this my self.
Thankyou! ?