SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    NC
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can a link to confim call a custom javascript function

    Hello - I have a custom javascript confirm function that I wanted to add to a link_to method.

    The function replaces specific text fields depending if the user chooses cancel or ok.

    Can this be done?

  2. #2
    SitePoint Guru
    Join Date
    Apr 2007
    Posts
    813
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you were trying to do in place editor, they have the method available to do that.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think link_to_remote would be a better method to use.

    I can highly recommend you invest in "Ajax on Rails", which is the best thing I've read for describing how to use Javascript with Rails. There is a good section in chapter 3 called "Ajax links" that describes how to do what you want.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •