TOPIC:

BF : Test for limit number 1 year 3 months ago #238127

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 248
  • Thanks: 6
Hi,

BF Multi-pages, I would like to jump to an CLOSED page, if "Nb of records" is over a Limit Nb, else to continue to the Form (p3).

1/ I have create on P1 a "hidden element (Nb)" with "default value = 10 (my limit), then I've add script but it doesn't work correctly:
function ff_Nb_init() {
var Nb1 = ff_getElementByName("Nb").value ; // Nb limite
var Nb2 = 3 ; // Nb2 = Nb of records (I will calculate later)

// Test NB2 < Nb1 = Limite (Nb)
if ( Nb2 < Nb1 ) { // Continue Form
ff_switchpage(3) ; }
else { // NB > Limite : Go to closed page
ff_switchpage(2) ; }
} // function ff_Nb_init

Could you please help?
Thks,

Please Log in or Create an account to join the conversation.

BF : Test for limit number 1 year 3 months ago #238133

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

I have tested the Initscript code that you have provided and, for me, it is working fine.

When I enter the form I am momentarily being redirected to page 3, since 3<10.

Please check whether you have checked the "Form Entry" or "Page Entry" checkbox in the initscript section. In case you haven't this would not work.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

BF : Test for limit number 1 year 3 months ago #238135

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 248
  • Thanks: 6
Hi,
Yes, you are right! I may have fix my bug while translating to English...

How to display "Nb" value in page 2 (over limit), in "PAGE edit" message or another trick?
thks, Gil

Please Log in or Create an account to join the conversation.

BF : Test for limit number 1 year 3 months ago #238140

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

I'm sorry but I do not understand what you are asking.

If I've understood previously, Nb has a predefined value 10 so you can just write that number where needed.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

BF : Test for limit number 1 year 3 months ago #238142

  • Topic Author
  • Gilles361
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 248
  • Thanks: 6
Once I jump to "Form close" page (2), I've TEXT + Image message. Also, I would like to DISPLAY : "Nb of records" or "Nb = Limit" element value.

Rgds, Gil

Please Log in or Create an account to join the conversation.

BF : Test for limit number 1 year 3 months ago #238143

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Maybe it would be the best that on this second page you create a Textfield and mark it as read-only.
Then you can write Initscript for this element to copy the value from Nb to this field on the second page.

The other solution, how to compone this into wanted intro text is a bit more complicated. To achieve so, do as follows:

1) Go to the Edit > Intro of your page (2). In the editor go to Tools > Source Code.
In the box that appears add this HTML code:
Nb of records is <span id="myid">newtext</span>
Make sure to save the whole form to save the change.

2) Go to form's Advanced properties > More options and in Initialization script set type to Custom and put there the following code:
function ff_FORMNAME_init()
{
setInterval('calc()', 500);
} // ff_FORMNAME_init

function calc() {
var pom=  ff_getElementByName('Nb').value;
jQuery("#myid").text(pom);
}
NOTE: In the code above replace FORMNAME with the actual name of your form.

That will, for example, result in a text like this on the second page:
"Nb of records is 8".

Let me know whether you have managed to set this for your form and whether it is working as you wanted.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!