At first I thought this was a cross-browser issue of Prototype when
Form.Element.present() used on a select box returned "true" on Firefox
but not on IE when a non-empty OPTION field was selected.

Later then, I realized that this method was in fact just meant for
text inputs (as clearly stated in the documentation: "Returns true if
a text input has contents, false otherwise.").

Still, I think it would be nice to have the functionality of the
Form.Element.present method extended so that the following example
would work on all browsers the way I thought it would at first
("false" when no or the empty option is selected, "true" otherwise):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


    <script type="text/javascript" src="prototype.js"></script>
    <script type="text/javascript">
    document.observe("dom:loaded", function () {
      $("mySelect").observe("change", function () {
        alert($("mySelect").present() ? "select set" : "select not


    <select id="mySelect">


What do you think?
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to