Client side v Server side

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

Client side v Server side

#1

Postby Steve James » Wed Aug 26, 2015 3:16 pm

Hi, we've got a couple of forms where on submission we do some stuff and then using a gotoform (POST) command we'd pass onto a 3rd party Payment Portal. We are working with call recording software so we need to stop voice recording while the contact centre advisor is taking card details. The form is displayed in our CRM system and unfortunately the voice recording software cannot detect any web pages while in our CRM. So we are happy for the Payment Portal pages to open in our default browser so our recording software can do the necessary.

We've got this working on a number of forms via client side scripts on the submit button and it is working well (a bit of a compromise but acceptable).

We do have 1 form where we have a large FPL script that needs to run before the client side script.

options
  • move the FPL to a different element so it has been called before the submit button is pressed. This isn't feasible as there isn't a suitable element.

    add another button for the user to press (and some blurb) that calls the FPL and then the button containing the client script to goto to the Payment Portal. This is ugly yet fast but opens the risk that users do not go on to take payment.

    convert the FPL to javascript and call it from the client before the goto Payment Portal is called (more work than anticipated).
Does anyone have any other possibilities? It is looking like the conversion to javascript is the way we will have to go but this means much more work / testing.

Thanks
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Aug 26, 2015 4:54 pm

How about having a hidden button (hidden with display:none) that runs the server-side FPL script. Then invoke a click on this button via Javascript. This will then run the script and re-display the page. You could include some extra Javascript at this point, say in HTML++ or a control ready event that then calls the payment portal.
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#3

Postby Steve James » Thu Aug 27, 2015 10:46 am

Thanks for that Jon, I'd thought about hiding the button but discounted it due to the risk of loosing sight of the logic in the future.

Your post made me think differently and a good solution was found kind of using your suggestion plus option 1 below (ie move the FPL to a different element so it has been called before the submit button is pressed)

Essentially we moved the client script to an element after the button.

User clicks the button as normal and the server side scripts fire as normal, we added a text element after the button which is hidden, when the script concludes it shows the text element and displays "case created blah blah" and it has a ready event to then fire the client side stuff. A bit of extra logic as the ready event appeared to be for the document even though it was placed on the html element properties for the text element.

Code: Select all

if ($("#TXTPostCaseCreate").is(":visible"))
{
run client script;
}
All events in the right order with minimal rework to an existing form!

Thanks again
0 x


Who is online

Users browsing this forum: No registered users and 13 guests