Jump to content

Simulate Click On Fb Login

Recommended Posts

I currently have my own button designed which flows with my site and I want to use my buttons instead of the buttons provided by Caspio.  I have it setup where the Caspio page is hidden and when the User clicks my Facebook Login button, it executes code,

$('#hiddenForm').contents.find('[title="Sign in with Facebook"]').click();

This looks into the iFrame which holds the Caspio Login button and simulates a click on the button.  This then loads the popup Facebook auth window.  After the user agrees and the popup closes, the iFrame reloads.  But instead of it loading to my Facebook registration it loads the main registration page into the iFrame then in that the facebook registration page.


This is only an issue when the Caspio facebook button is not clicked by the user and the click is not initiate from the same location.  It seems to to load up the url of the page the initiated the call that clicked the Caspio Button.  If i set my code to run on load from within the authentication footer, it properly clicks the link and loads the page as expected.  It only causes issue if I use my code to go from one page to an iframe embedded in the page.  


So when I should end up with, My main registration page with an iframe containing my facebook registration page, I end up with, My main registration page with an iFrame containing my main registration page containing an iframe containing my facebook registration page.


Attached is a picture of what happens when my code runs and the break up of what is an iframe and what is my page.



Thanks for any help,



Link to comment
Share on other sites

Hello Adam!

If I understand you correctly, maybe it is the better - to change the Facebook Login button with a Style?

The idea is:

1) Create a Style.

2) Open the Style, to select the "Form/Details" - "Fields" in the "DataPage Elements" Tab.

3) Select the "ID Services Image Action" item at the end of the list.

4) Select the "Custom" item in the correspond "Layout Image Option" field (or select "Custom" in all three fields)

5) The "Custom Images" tab becomes enabled.

6) Enter correct URLs to images for all Services. If you plan to use only one Service - you can paste the same URL to all fields.

7) Attach the Style to your DataPage.

Now, when a user opens the Login page, he sees your image instead the Default Facebook login image.

Sorry, if your goal is another :)

Link to comment
Share on other sites

Thanks for the reply,


I was unaware of these settings and if I was using straight images this would work fine but my buttons are styled with css and involve style changes on hover and click which I cant replicate with a static image.  But for most people this will probably be the right way to do this.  I have switched to using the API to bypass the authentication and use my custom designs across the site.


If anyone does know why, I would like to know why the Caspio facebook button works the way it does with tracking backwards through calls to find where the call initiated and loading that page instead of the page the authentication was meant for.


But as I believe you answered the question with what is probably the best solution for someone not as picky as I am I will accept that as the solution.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...