0

I am trying to figure out how to simply add a facebook share function upon click/submit of a form button. I would assume this will be done in jquery but I am not sure. ANY HELP WILL BE APPRECIATED.

I am trying to add an "onClick" function to this submit button to open up share to facebook once it is submitted/clicked.

<input class="btn btn-primary" onclick="window.open='http://www.facebook.com/sharer.php?s=%20100&amp;p[title]=Bedding'" type="submit" value="Wish It" name="wishit" id="wishit">
ceejayoz
  • 176,543
  • 40
  • 303
  • 368

1 Answers1

1

To add the share button, you can use the following code and paste it on your page

<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fparse.com" target="_blank">
 Share on Facebook
</a>

Meanwhile you can look at this for more information.... https://developers.facebook.com/docs/plugins/share-button/

Minelava
  • 221
  • 1
  • 7
  • 21
  • Thanks but I am really trying to tie this to the submit function. I want the share window to come up after the user hits the submit button. – user3047645 Nov 29 '13 at 01:22
  • OK, So I sort of got it. I use this `code` Wish It `code` I would like it to open a popup instead of a new window/tab. Is there any way to do this? Thanks – user3047645 Nov 29 '13 at 01:30
  • I think you might need to use javascript for it to work http://stackoverflow.com/questions/12882689/launch-facebook-share-popup-at-center-of-screen – Minelava Nov 29 '13 at 01:32