[Seaside] How to run js on client side using JSScript?

Paul DeBruicker pdebruic at gmail.com
Tue Sep 20 15:52:22 UTC 2011


I think you should use onChange.  I'm not familiar with scriptaculous 
but using jQuery rather than scriptaculous it'd look like this:

html select
	list: dropDownListChoices
	onChange:html jQuery ajax serializeThis;
	callback:[:val | self halt.].





On 09/20/2011 10:57 AM, squeakman wrote:
> Hello,
>
> I have a dropdownList using an "html select". When the user clicks on an
> item in the list, I would like to know the index of the selected item.
>
> I am using the callback:value: method to try and get the value of the
> selected index but what I am getting back is the literal string of the
> javascript code.
>
> What do I have to do to get the code
> document.getElementById('listItems').selectedIndex
> to be run on the client side and have the results returned to me?
>
>
> Thanks,
> Frank
>
> ----- code follows ----
>
>
> | javaScriptCode |
>
> javaScriptCode := Javascript.JSScript new add:
> 'document.getElementById(''listItems'').selectedIndex'; yourself.
>
> (html select)
> id: 'listItems';
> list: dropDownListChoices;
> callback: [:v | ];
>
> onClick: ((html scriptaculous request)
> triggerForm: (html scriptaculous element up: 'form');
> callback: [:v | self halt]
> value: javaScriptCode )
>
>
>
>
>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list