|
-
Apr 30th, 2004, 05:14 AM
#1
Thread Starter
Fanatic Member
Problems with selectbox & Jscript
-
Apr 30th, 2004, 05:44 AM
#2
Just incrementing the length doesn't add an actual item!
Code:
<script type="text/javascript">
function submitform_list() {
var form = document.getElementById("choiceForm");
var select = form.elements["MyAccount"];
var option = document.createElement("option");
option.text = "BombDrop";
option.value = "123";
select.appendChild(option);
// Now there's a real new option there.
alert(select.options[select.options.length-1].value);
}
</script>
http://www.quirksmode.org/
contains a lot of resources on proper JavaScript.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|