Hi Johan,
<br/><br/>because the value parameter of the field does only contain the letters
<br/>the user just entered and not the whole name of the adress which was
<br/>selected by the user. E.g. user typed in 'd' and selected 'Dallas,Tx'
<br/>from the list. Now, the value parameter of the field does only contain
<br/>the 'd' and not 'Dallas, Tx'.
<br/><br/>The following code shows this as demo, you need only the 2 methods
<br/>below and setter/getter for startPlace.
<br/>There is a second textinput 'testTextField' that is also populated
<br/>with the adress selected.
<br/>So I see, ths js is working.
<br/>But within the callback, the inspector shows me, that only the typed
<br/>letters will be saved and not the whole selected adress.
<br/><br/>renderContentOn: html
<br/> | mid fid |
<br/> mid := 'widgetId'.
<br/> fid := 'formId'.
<br/> html
<br/> html:
<br/> ('<script type="text/javascript">
<br/> jQuery(function() \{
<br/>var input = document.getElementById(''widgetId'');
<br/>var autocomplete = new google.maps.places.Autocomplete(input);
<br/>google.maps.event.addListener(autocomplete, ''place_changed'', function() \{
<br/>var place = autocomplete.getPlace();
<br/>var adr = place.formatted_address;
<br/>jQuery(''#widgetId'').val(adr);
<br/>jQuery(''#testTextField'').val(adr);
<br/>});
<br/>});
<br/></script>
<br/><br/><div>
<br/><input id="testTextField" type="text" size="50"/>
<br/></div>
<br/><br/> '
<br/><br/> format: {mid}).
<br/> html textInput
<br/> id: mid;
<br/> size: 45;
<br/> value: self startPlace;
<br/> callback: [ :value |
<br/> value inspect.
<br/>
<br/> self startPlace: value ];
<br/>
<br/> onChange:
<br/> (html scriptaculous updater
<br/> id: mid;
<br/> triggerForm: fid;
<br/> callback: [ :r | r render: startPlace ]);
<br/> onBlur: html jQuery ajax serializeThis
<br/><br/><br/>updateRoot: aHtmlRoot
<br/><br/>super updateRoot: aHtmlRoot.
<br/>aHtmlRoot javascript url:
<br/>'<a href="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'" target="_top" rel="nofollow" link="external">https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'</a>.
<br/>aHtmlRoot javascript url:
<br/>'<a href="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places'" target="_top" rel="nofollow" link="external">https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places'</a>.
<br/><br/><br/><br/>On Tue, Jul 16, 2013 at 4:01 PM, Johan Brichau-2 [via Smalltalk]
<br/><<a href="/user/SendEmail.jtp?type=node&node=4698952&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:
<div class='shrinkable-quote'><br/>> Sabine,
<br/>>
<br/>> I'm a bit confused: why is the value parameter of the callback of the field
<br/>> not enough?
<br/>>
<br/>> Sent from my iPad
<br/>>
<br/>> On 16 Jul 2013, at 15:40, Sabine Knöfel <[hidden email]> wrote:
<br/>>
<br/>> Hi Johan,
<br/>>
<br/>> I want to get the value of the textinput within the callback of the
<br/>> textinput.
<br/>>
<br/>> Explanation:
<br/>> With Google Places autocompleter
<br/>> (<a href="http://webtrouble.blogspot.de/2013/01/google-address-autocomplete.html" target="_top" rel="nofollow" link="external">http://webtrouble.blogspot.de/2013/01/google-address-autocomplete.html</a>),
<br/>> the user selected a place which is displayed in the textInput.
<br/>> This works fine.
<br/>>
<br/>> Now, I want to save this place in my model.
<br/>>
<br/>> renderStartPlaceOn: html
<br/>>
<br/>> "this script sets the selected place in the field with the id 'mid'"
<br/>> html html: ('<script type="text/javascript">
<br/>> jQuery(function() \{
<br/>> var input = document.getElementById(''{1}'');
<br/>> var autocomplete = new google.maps.places.Autocomplete(input);
<br/>> google.maps.event.addListener(autocomplete, ''place_changed'', function() \{
<br/>> var place = autocomplete.getPlace();
<br/>> var adr = place.formatted_address;
<br/>> jQuery(''#{1}'').val(adr);
<br/>> });
<br/>> });
<br/>> </script>' format: {mid}).
<br/>>
<br/>> "this is the text input with id 'mid' "
<br/>> html textInput
<br/>> id: mid;
<br/>> size: self defaultEntryFieldWidth;
<br/>> value: self startPlace;
<br/>> callback: [ :value | |theStartPlaceString|
<br/>> "**********This does not work, how can I get the value from the mid
<br/>> field which was set by the script above?********"
<br/>> theStartPlaceString:= html jQuery ajax
<br/>> callback: [:v | v inspect. ]
<br/>> value: (html jQuery id:
<br/>> #searchTextField) value.
<br/>> self startPlace: theStartPlaceString ];
<br/>> onChange:
<br/>> (html
<br/>> scriptaculous updater
<br/>>
<br/>> id: mid;
<br/>>
<br/>> triggerForm: fid;
<br/>>
<br/>> callback: [ :r |
<br/>>
<br/>> r render: self startPlace ]);
<br/>> onBlur: html jQuery ajax serializeThis.
<br/>>
<br/>> Greetings
<br/>> Sabine
<br/>>
<br/>>
<br/>>
<br/>> On Tue, Jul 16, 2013 at 3:15 PM, Johan Brichau-2 [via Smalltalk]
<br/>> <[hidden email]> wrote:
<br/>>
<br/>>> Hi Sabine,
<br/>>>
<br/>>> I guess you want the value server-side?
<br/>>> You thus need to serialize that value:
<br/>>>
<br/>>> html jQuery ajax
<br/>>> callback: [:v | ... ]
<br/>>> value: (html jQuery id: #searchTextField) value
<br/>>>
<br/>>> Johan
<br/>>>
<br/>>> Sent from my iPad
<br/>>>
<br/>>> On 16 Jul 2013, at 14:01, Sabine Knöfel <[hidden email]> wrote:
<br/>>>
<br/>>>> Hi,
<br/>>>>
<br/>>>> I want to get the value which was entered into a textinput by doing
<br/>>>>
<br/>>>> (html jQuery id: #searchTextField) value.
<br/>>>>
<br/>>>> but I get
<br/>>>> a JQueryInstance
<br/>>>> (jQuery("#searchTextField").val())
<br/>>>>
<br/>>>> How can I get the value (String) of the text field?
<br/>>>>
<br/>>>> Greetings
<br/>>>> Sabine
<br/>>>>
<br/>>>>
<br/>>>>
<br/>>>>
<br/>>>>
<br/>>>> --
<br/>>>> View this message in context:
<br/>>>>
<br/>>>> <a href="http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913.html" target="_top" rel="nofollow" link="external">http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913.html</a><br/>>>> Sent from the Seaside General mailing list archive at Nabble.com.
<br/>>>> _______________________________________________
<br/>>>> seaside mailing list
<br/>>>> [hidden email]
<br/>>>> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>>> _______________________________________________
<br/>>> seaside mailing list
<br/>>> [hidden email]
<br/>>> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>>>
<br/>>>
<br/>>> ________________________________
<br/>>> If you reply to this email, your message will be added to the discussion
<br/>>> below:
<br/>>>
<br/>>> <a href="http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698938.html" target="_top" rel="nofollow" link="external">http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698938.html</a><br/>>> To unsubscribe from get value within a textinput with jQuery, click here.
<br/>>> NAML
<br/>>
<br/>> ________________________________
<br/>> View this message in context: Re: get value within a textinput with jQuery
<br/>>
<br/>> Sent from the Seaside General mailing list archive at Nabble.com.
<br/>>
<br/>> _______________________________________________
<br/>> seaside mailing list
<br/>> [hidden email]
<br/>> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>>
<br/>>
<br/>> _______________________________________________
<br/>> seaside mailing list
<br/>> [hidden email]
<br/>> <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_top" rel="nofollow" link="external">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br/>>
<br/>>
<br/>> ________________________________
<br/>> If you reply to this email, your message will be added to the discussion
<br/>> below:
<br/>> <a href="http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698947.html" target="_top" rel="nofollow" link="external">http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698947.html</a><br/>> To unsubscribe from get value within a textinput with jQuery, click here.
<br/>> NAML
<br/></div>
        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://forum.world.st/get-value-within-a-textinput-with-jQuery-tp4698913p4698952.html">Re: get value within a textinput with jQuery</a><br/>
Sent from the <a href="http://forum.world.st/Seaside-General-f86180.html">Seaside General mailing list archive</a> at Nabble.com.<br/>