Full page loader with submit button

Hi, is it possible to do a full page screen loader with normal submit button instead of ajax submit? 

Solution

Hi Yifan, 

Yep, drop a button on your loading page, set your target action and leave the submit as 'Submit'. Set a custom attribute of style with a value of 'display:none;'  give your button a Name like 'btn_SubmitOnLoadComplete'

when your loader reaches 100%. trigger a screen action that either runs some javascript (use query or vanilla javascript to get the button by Id, which is the name you gave it) to trigger the button click on use Widget_Click from RichWidgets.

JQuery: $("'#"+ btn_SubmitOnLoadComplete.Id + "').click();

or JS: document.getElementById('" + btn_SubmitOnLoadComplete.Id +"').click();

or just use Widget_Click


If you're talking about mobile, I don't think there's any 'submit' vs Ajax submit, it's all React on a Document Object Model.


Not sure what your goal is in getting a submit vs an Ajax submit but be aware, when ever the user reloads the following page, they will get a popup message asking them if they want to re-submit the form (from when you trigged a non-ajax submit.  


hope this helps.

Solution

Steve Bramley wrote:

Hi Yifan, 

Yep, drop a button on your loading page, set your target action and leave the submit as 'Submit'. Set a custom attribute of style with a value of 'display:none;'  give your button a Name like 'btn_SubmitOnLoadComplete'

when your loader reaches 100%. trigger a screen action that either runs some javascript (use query or vanilla javascript to get the button by Id, which is the name you gave it) to trigger the button click on use Widget_Click from RichWidgets.

JQuery: $("'#"+ btn_SubmitOnLoadComplete.Id + "').click();

or JS: document.getElementById('" + btn_SubmitOnLoadComplete.Id +"').click();

or just use Widget_Click


If you're talking about mobile, I don't think there's any 'submit' vs Ajax submit, it's all React on a Document Object Model.


Not sure what your goal is in getting a submit vs an Ajax submit but be aware, when ever the user reloads the following page, they will get a popup message asking them if they want to re-submit the form (from when you trigged a non-ajax submit.  


hope this helps.


Hi Steve,

thanks for the suggestion, I have a web page on which I need to trigger the page loader upon the closing of one of my pop ups. I have used the widget click on a hidden button to trigger Page Loader(downloaded from forge) but it would not work.

Thus, I am trying to see if there is any other viable method to achieving the same idea.

Hi Yifan, 

how did it not work?  not submitting?  didn't redirect to where you expected?  if it's not submitting, you may have hidden it with the wrong method perhaps?  it must be display:none on the style, otherwise the button + widget click won't work.

if you're not getting the redirect you want, you can redirect using the external url widget with a link to the page you want (for that matter you can also trigger a click off a hidden hyperlink too)

happy to have a look at your Espace if you want to share it.


Steve Bramley wrote:

Hi Yifan, 

how did it not work?  not submitting?  didn't redirect to where you expected?  if it's not submitting, you may have hidden it with the wrong method perhaps?  it must be display:none on the style, otherwise the button + widget click won't work.

if you're not getting the redirect you want, you can redirect using the external url widget with a link to the page you want (for that matter you can also trigger a click off a hidden hyperlink too)

happy to have a look at your Espace if you want to share it.


I have retried it using a simpler version of my current project it appears to have worked, I was having it click the wrong hidden button.

Thanks alot for the help.


Hi Yifan,


Instead of using widget click, try to run the piece of code that Steve posted by using the RunJavaScript action.


document.getElementById('" + btn_SubmitOnLoadComplete.Id +"').click();




Cheers



Hugo Antunes wrote:

Hi Yifan,


Instead of using widget click, try to run the piece of code that Steve posted by using the RunJavaScript action.


document.getElementById('" + btn_SubmitOnLoadComplete.Id +"').click();




Cheers




Hi, thanks for the suggestion, but can you explain what is the difference between using javascript to click the button and using the widget click action? I have tried out both ways and they both work for my scenario.