It's a simple Javascript function or three... all based around the onClick event. It would look something like this (this won't work, but will show you how to do it):
function output() { var x; x = document.getElementById('whatever').value; document.getElementById('cost').value = x; return; }
'
See? Pretty simple. Now you just have to extrapolate that out to a working script, using some pretty basic "if" statements (or a switch, I guess, but I prefer "if")
Well, I've given you to start with... why not try and learn?
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
kb posted this at 21:04 — 31st July 2007.
He has: 1,380 posts
Joined: Feb 2002
You could... write it?
It's a simple Javascript function or three... all based around the onClick event. It would look something like this (this won't work, but will show you how to do it):
<select onChange='output()' id="whatever"><option name="1" value="1">1</option><option name="2" value="2">2</option></select>
<input type="text" id="cost" />
function output() {
var x;
x = document.getElementById('whatever').value;
document.getElementById('cost').value = x;
return;
}
See? Pretty simple. Now you just have to extrapolate that out to a working script, using some pretty basic "if" statements (or a switch, I guess, but I prefer "if")
Angelz posted this at 21:29 — 31st July 2007.
They have: 2 posts
Joined: Jul 2007
Thanks. I don't know how to write javascript.
kb posted this at 21:32 — 31st July 2007.
He has: 1,380 posts
Joined: Feb 2002
Well, I've given you to start with... why not try and learn?
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.