开发者

Getting the value of the Javascript receiver in a Seaside JQuery callback

开发者 https://www.devze.com 2023-02-05 09:49 出处:网络
My question is similar to this - how do get what would be javascript开发者_JS百科 this (so that I can get its value assuming its a form text input) ? I am trying to send the value of a text input to t

My question is similar to this - how do get what would be javascript开发者_JS百科 this (so that I can get its value assuming its a form text input) ? I am trying to send the value of a text input to the callback you see:

html textInput id: #thingy; 
 onClick: (html jQuery ajax 
  callback:[:x | x inspect]
  value:(html jQuery event currentTarget ????));
   with: 'I am the value the poster wants to see inspected in the above callback block!'.


If you want to fire the callback when you click simply bind serializeThisWithHidden on the onClick event.

html textInput id: #thingy; 
 onClick: (html jQuery ajax serializeThisWithHidden);
  callback:[:x | x inspect];
  with: 'I am the value the poster wants to see inspected in the above callback block!'.

Out of my head :)


To get the value in the ajax callback you would use

html textInput id: #thingy; 
        onClick: (html jQuery ajax 
        callback:[:x | x inspect] value: html jQuery new value);
        with: 'I am the value the poster wants to see inspected in the above callback block!'.
0

精彩评论

暂无评论...
验证码 换一张
取 消