I'm all new into js so I'm kind of stuck with this script of mine.
I need it to fetch the choosen value in a dropdown menu when the user clicks an "Add" button. The value should then be stored somehow, so that the next time he clicks the same "Add" button, but maybe chooses another value from the drop-down, the script stores this value and so on. I've been thinking of doing it through an dynamic array, but I'm all stuck....Here's what I got so far..
Expand|Select|Wrap|Line Numbers
- <script>
- function addMailAddressses(){
- var email = document.form.Mail.value
- agree = confirm('Is the choosen e-mailaddress correct: ' + email )
- if (agree){
- alert('The address, ' + email + ' , has been added.')
- var emails = newArray(9);
- var i;
- for (i = 1; i < 10; i++) {
- emails[i] = email + ';';
- }
- else {
- return false
- }
- }
- </script>