I have a form with a select, like

<select name="myfield">
  <option value="">choose something</option>
  <option value="1">Fred</option>
</select>


If the user has left the select box on "choose something", I want 
querystring to return:

&myfield=

but instead, formContents is returning:

&myfield=choose something.

I am looking at the latest MochiKit.js (compressed) from svn rev 
1256.

I do not know why this choice was made:

var opt=elem.options[elem.selectedIndex];
var v=opt.value;
if(!v){
  var h=opt.outerHTML;
  if(h&&!h.match(/^[^>]+\svalue\s*=/i)){
    v=opt.text;
  }
}

I don't understand what the regex is trying to do, but in any case, 
I'm not
getting the result I expect.

Instead of:

if(!v)

should it be:

if( typeof(v) == 'undefined') )


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to