join all form field in text-area - problem with internet explorer
Hi there,
i´m quite new to javascript and have a question to my first "project":
I want a documentation utility for work in which i can document hotline-calls.
So i made a form and an output textarea where all form field should display after pressing the button.
while this works on firefox and chrome it wont work on internet explorer. But I need an internet explorer compatible solution...can you point out whats wrong with it ?
I posted it on jsfiddle.....ffel free to "mess arround" with it :
FF and Chrome are a lot more lenient - if they are asked for an option value and there isn't one they will use the option text as a fallback, but this is one of the few instances where I think that IE is doing the right thing
...but this is one of the few instances where I think that IE is doing the right thing
For me, those instances are rare, indeed. But I agree with you.. options should be forced to have both value and text.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
When an <option> without a value= is selected and the <form> is sent to server-side processing, indeed *ALL* browsers (by specification) then instead send the text of that <option>.
So, from the server-side view of things, in the absence of a value, the text is the value.
So those browsers that do the same thing with the DOM (and it *is* the DOM, not JavaScript, never forget) can be said to simply be emulating normal browser behavior.
Still, it does seem a violation of the tradition of the DOM.
Here's an interesting tidbit: Originally, the *ONLY* browser that allowed you to use formreference.selectName.value was MSIE! Netscape *INSISTED* that you must use form.select[form.select.selectedIndex].value Again, in the original spirit of the DOM, I think Netscape was right. But MSIE prevailed and now all browsers support form.select.value and now we have the ironic situation that all except MSIE have taken the DOM-enhancement one step further.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
I quite like formreference.selectName.value - I don't really mind about violating the spirit of the DOM or whatever. It seems to me that a select having a raw value is in keeping with other form elements (even though I know that it's not actually the select tag that holds the value but the option tag, but then the select tag is *never* going to have a value, so there is no ambiguity for me).
But then I like to live on the edge. I personally look forward to the day when we can do formreference.selectName.text