Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:07:45+00:00 2026-05-25T19:07:45+00:00

I have a button that should open up a popup but instead reloads the

  • 0

I have a button that should open up a popup but instead reloads the page. I use link_to which works, but the button_to doesn’t. Changing the button_to to a GET request doesn’t work. How do I force it?

<%= button_to "Invite your friends", :id => "invite_fb_friends" %>
<div id="fb-root">
  <script src="http://connect.facebook.net/en_US/all.js"></script>
  <script>
      $(function(){
      $("a#invite_fb_friends").click(function(event) {
        FB.init({
        appId:'255295947482349',
        cookie:false,
        status:true
      });
        FB.ui({
        method: 'apprequests',
        message: 'This is a test message.'});
        event.preventDefault();
        return false;
      });
     });
  </script>
</div>

Resulting HTML:

#For the button

<form method="post" action="/profile?id=invite_fb_friends" class="button_to">
<div><input type="submit" value="Invite your friends" />
<input name="authenticity_token" type="hidden" value="1bgr+0o9j/gs4sgD7hItkc3BFR1ewVh5VyXCZRoMrtY=" />
</div></form>

#For the link
<div id="friends">
<p><a href="#" id="invite_fb_friends">invite your friends</a></p>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:07:46+00:00Added an answer on May 25, 2026 at 7:07 pm

    button_to generates a form with a submit button that posts the form.
    Maybe you should try link_to or just regular markup:

    <input type="button" value="Invite your friends" id="invite_fb_friends" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I have is button that should open another page only if textbox length
I have a button that should open up a popup for a Facebook invite
Presently I have a button which will open a popup and it also pass
I have a button <a> that should toggle a drop-down Then it should also
I have a group of buttons that should act like toggle buttons, but also
I have a send message button and on clicking that I open a website
On my web page I have a button that opens a modal jQuery dialog.
how can I programm a button so that when clicked should open the save
I have a button that I would like to disable when the form submits
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.