[Seaside] Re: get value within a textinput with jQuery
Johan Brichau
johan at inceptive.be
Tue Jul 16 14:00:29 UTC 2013
Sabine,
I'm a bit confused: why is the value parameter of the callback of the field not enough?
Sent from my iPad
On 16 Jul 2013, at 15:40, Sabine Knöfel <sabine.knoefel at gmail.com> wrote:
> Hi Johan,
>
> I want to get the value of the textinput within the callback of the textinput.
>
> Explanation:
> With Google Places autocompleter
> (http://webtrouble.blogspot.de/2013/01/google-address-autocomplete.html),
> the user selected a place which is displayed in the textInput.
> This works fine.
>
> Now, I want to save this place in my model.
>
> renderStartPlaceOn: html
>
> "this script sets the selected place in the field with the id 'mid'"
> html html: ('<script type="text/javascript">
> jQuery(function() \{
> var input = document.getElementById(''{1}'');
> var autocomplete = new google.maps.places.Autocomplete(input);
> google.maps.event.addListener(autocomplete, ''place_changed'', function() \{
> var place = autocomplete.getPlace();
> var adr = place.formatted_address;
> jQuery(''#{1}'').val(adr);
> });
> });
> </script>' format: {mid}).
>
> "this is the text input with id 'mid' "
> html textInput
> id: mid;
> size: self defaultEntryFieldWidth;
> value: self startPlace;
> callback: [ :value | |theStartPlaceString|
> "**********This does not work, how can I get the value from the mid
> field which was set by the script above?********"
> theStartPlaceString:= html jQuery ajax
> callback: [:v | v inspect. ]
> value: (html jQuery id: #searchTextField) value.
> self startPlace: theStartPlaceString ];
> onChange:
> (html scriptaculous updater
> id: mid;
> triggerForm: fid;
> callback: [ :r |
> r render: self startPlace ]);
> onBlur: html jQuery ajax serializeThis.
>
> Greetings
> Sabine
>
>
>
> On Tue, Jul 16, 2013 at 3:15 PM, Johan Brichau-2 [via Smalltalk]
> <[hidden email]> wrote:
>
> > Hi Sabine,
> >
> > I guess you want the value server-side?
> > You thus need to serialize that value:
> >
> > html jQuery ajax
> > callback: [:v | ... ]
> > value: (html jQuery id: #searchTextField) value
> >
> > Johan
> >
> > Sent from my iPad
> >
> > On 16 Jul 2013, at 14:01, Sabine Knöfel <[hidden email]> wrote:
> >
> >> Hi,
> >>
> >> I want to get the value which was entered into a textinput by doing
> >>
> >> (html jQuery id: #searchTextField) value.
> >>
> >> but I get
> >> a JQueryInstance
> >> (jQuery("#searchTextField").val())
> >>
> >> How can I get the value (String) of the text field?
> >>
> >> Greetings
> >> Sabine
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >> http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913.html
> >> Sent from the Seaside General mailing list archive at Nabble.com.
> >> _______________________________________________
> >> seaside mailing list
> >> [hidden email]
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > _______________________________________________
> > seaside mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698938.html
> > To unsubscribe from get value within a textinput with jQuery, click here.
> > NAML
>
> View this message in context: Re: get value within a textinput with jQuery
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20130716/23a239e0/attachment-0001.htm
More information about the seaside
mailing list