<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Sabine,</div><div><br></div><div>I'm a bit confused: why is the value parameter of the callback of the field not enough?<br><br>Sent from my iPad</div><div><br>On 16 Jul 2013, at 15:40, Sabine Knöfel &lt;<a href="mailto:sabine.knoefel@gmail.com">sabine.knoefel@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>Hi Johan,
<br><br>I want to get the value of the textinput within the callback of the 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: ('&lt;script type="text/javascript"&gt;
<br>&nbsp; &nbsp; &nbsp; &nbsp; 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>&lt;/script&gt;' format: {mid}).
<br><br>"this is the text input with id 'mid' "
<br>html textInput
<br>&nbsp; &nbsp; &nbsp; &nbsp; id: mid;
<br>&nbsp; &nbsp; &nbsp; &nbsp; size: self defaultEntryFieldWidth;
<br>&nbsp; &nbsp; &nbsp; &nbsp; value: self startPlace;
<br>&nbsp; &nbsp; &nbsp; &nbsp; 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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; theStartPlaceString:= html jQuery ajax
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;callback: [:v | v inspect. ]
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value: (html jQuery id: #searchTextField) value.
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self startPlace: theStartPlaceString ];
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onChange:
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (html scriptaculous updater
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id: mid;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; triggerForm: fid;
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; callback: [ :r |
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;r render: self startPlace ]);
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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>&lt;<a href="/user/SendEmail.jtp?type=node&amp;node=4698942&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>&gt; wrote:
<div class="shrinkable-quote"><br>&gt; Hi Sabine,
<br>&gt;
<br>&gt; I guess you want the value server-side?
<br>&gt; You thus need to serialize that value:
<br>&gt;
<br>&gt; html jQuery ajax
<br>&gt; &nbsp; &nbsp; callback: [:v | ... ]
<br>&gt; &nbsp; &nbsp; value: (html jQuery id: #searchTextField) value
<br>&gt;
<br>&gt; Johan
<br>&gt;
<br>&gt; Sent from my iPad
<br>&gt;
<br>&gt; On 16 Jul 2013, at 14:01, Sabine Knöfel &lt;[hidden email]&gt; wrote:
<br>&gt;
<br>&gt;&gt; Hi,
<br>&gt;&gt;
<br>&gt;&gt; I want to get the value which was entered into a textinput by doing
<br>&gt;&gt;
<br>&gt;&gt; (html jQuery id: #searchTextField) value.
<br>&gt;&gt;
<br>&gt;&gt; but I get
<br>&gt;&gt; a JQueryInstance
<br>&gt;&gt; (jQuery("#searchTextField").val())
<br>&gt;&gt;
<br>&gt;&gt; How can I get the value (String) of the text field?
<br>&gt;&gt;
<br>&gt;&gt; Greetings
<br>&gt;&gt; Sabine
<br>&gt;&gt;
<br>&gt;&gt;
<br>&gt;&gt;
<br>&gt;&gt;
<br>&gt;&gt;
<br>&gt;&gt; --
<br>&gt;&gt; View this message in context:
<br>&gt;&gt; <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>&gt;&gt; Sent from the Seaside General mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.
<br>&gt;&gt; _______________________________________________
<br>&gt;&gt; seaside mailing list
<br>&gt;&gt; [hidden email]
<br>&gt;&gt; <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>&gt; _______________________________________________
<br>&gt; seaside mailing list
<br>&gt; [hidden email]
<br>&gt; <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>&gt;
<br>&gt;
<br>&gt; ________________________________
<br>&gt; If you reply to this email, your message will be added to the discussion
<br>&gt; below:
<br>&gt; <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>&gt; To unsubscribe from get value within a textinput with jQuery, click here.
<br>&gt; 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-tp4698913p4698942.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 <a href="http://Nabble.com">Nabble.com</a>.<br></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>seaside mailing list</span><br><span><a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a></span><br><span><a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a></span><br></div></blockquote></body></html>