790f145e by Michael Richards

Use jQuery's .val() in getInputValue if window.jQuery is present. [#133]

1 parent 169311ac
......@@ -251,8 +251,15 @@ unbindEvent = (el, event, fn) ->
event = 'on' + event
el.detachEvent event, fn
# Returns the current input value for the specified element.
# Cross-browser input value getter.
getInputValue = (el) ->
if window.jQuery?
el = jQuery el
switch el[0].type
when 'checkbox' then el.is ':checked'
else el.val()
else
switch el.type
when 'checkbox' then el.checked
when 'select-multiple' then o.value for o in el when o.selected
......