<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <font face="Georgia">We had a very similar question on 28-29 Sept
      (see "Using the select tag")</font>. The end result was something
    like:<br>
    <br>
    (html select)<br>
    &nbsp;&nbsp;&nbsp; list: self genders;<br>
    &nbsp;&nbsp;&nbsp; selected: self contact gender;<br>
    &nbsp;&nbsp;&nbsp; enabled: [:ea | ea notNil];<br>
    &nbsp;&nbsp;&nbsp; labels: [:ea | ea ifNil: ['---'] ifNotNil: [ea
    printableVersion]];<br>
    &nbsp;&nbsp;&nbsp; callback: [:value | self contact gender: value].<br>
    <br>
    Cheers,<br>
    Bob<br>
    <br>
    On 10/13/11 10:03 AM, squeakman wrote:
    <blockquote cite="mid:j76r2s$rt6$1@dough.gmane.org" type="cite">Hello
      All,
      <br>
      <br>
      Is there a way to get the selectedItem when the Ajax callback is
      triggered in an html select?
      <br>
      <br>
      The following code snippet works for me but I think there must be
      a better way.
      <br>
      <br>
      (html select)
      <br>
      &nbsp; id: 'stocksList';
      <br>
      &nbsp; list: self listOfStocks;
      <br>
      &nbsp; onClick: (html scriptaculous request
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; callback: [:i |self selectedStockIndex: i asNumber +
      1.]
      <br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value: self jsForGetSelectedIndex).
      <br>
      <br>
      <br>
      Note that I am using the call:value: method.
      <br>
      <br>
      The "self jsForGetSelectedIndex" returns the javascript code that
      gets the selected index.
      <br>
      <br>
      In the callback: I use this returned value to figure out which
      item was selected.
      <br>
      <br>
      Is there a better way to do this?
      <br>
      <br>
      Thanks,
      <br>
      Frank
      <br>
      <br>
      _______________________________________________
      <br>
      seaside mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
      <br>
      <br>
    </blockquote>
  </body>
</html>