开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜