On Oct 23, 2010, at 1:48 AM, Amit Tomar wrote:

Hii all,
Sorry if it looks stupid question but i would like to know is it possible to return response of javascript's confirmbox or messagebox to ruby programme as a value .Means suppose i click on confirmbox's yes tab this respone stored in a variable and this variable is returned to ruby
programme where i call javascrpt ??


If you make that confirm statement return into a function that sends an Ajax request, or simply a normal full-page request to a URL, then sure. Here's the most basic example of what I mean:

<a href="/model/action/id" onclick="return confirm('Do you really mean it?');">Play Global Thermonuclear War</a>

If the confirm returns false, then the onclick event dies in place, and your URL is not requested by the browser.

Walter


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to