iOS devices redirection issue


#1

We have a HubForm on one of our website and it’s working great with Windows OS. However with iPhone and iPad we’re facing issue with redirection with parameter(?hubres=success)

The reason for the current process is so when someone fills out a content download form in our resources section then they don’t have to fill out any other forms to access other resources. The process works perfectly on every other device. The only devices we have issues with are iPhones and iPads. Hence, if support are able to provide a solution without us re-building our whole resource section it would be appreciated.


#2

@Ashish Do you get an error? Can you expand upon exactly what you are experiencing from the iOS side?


#3

@Ashish

There’s a bug with iOS browsers that force the forms to always redirect to a new page, even when the form is designed not to redirect. We handle this bug be checking to see if the visitor is using an iOS device, and catching that redirect and showing a thank you message instead of reloading the form after that redirect, but we can’t prevent the redirect from happening.

There are some other details in this previous post.


#4

@dadams Thanks for addressing and providing reference link for the same issue. I will liaise with my client for the same.


#5

I am Also Getting the same issue. I have added a hubspot form in Popup window but in ios devices it reloaded the page and not able to see thanks u message. please help me to find out the solution.


#6

@Developer_Viva

HubSpot has some global utility methods that you can use in conjunction with some custom JS code to launch the modal on pageload when the onFormSubmit callback is run for browsers that do not support the ajax submissions:

hbspt.forms.create({
    portalId: 'xxxxxxxx',
    formId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    inlineMessage: 'Your submit message here',
    onFormSubmit: function($form){
      if ( window.hubspot.utils.isBrowserIncompatibleWith204FormSubmissions() ) {
        // launch the modal with JavaScript here.
      }
    }
}); 

The window.hubspot.utils.isBrowserIncompatibleWith204FormSubmissions() method returns a boolean value. The method detects if the current browser in use has the bug described above.

@dadams It took me some time to find this method on my own - it would be extremely helpful to have advanced docuemtation somewhere that outlines what all the window.hubspot.utils methods do - they could prove to solve a lot of developers headaches with some more advanced implementation - and because HubSpots source code is compressed - it is hard to gauge what the parameters are and what types they expect.