TOPIC:

Setting conditional default values for textfields 3 years 11 months ago #179192

  • Topic Author
  • sonstephen0
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 3
  • Thanks: 0
How do I set conditional default values for textfield elements? I am working on a form in which a user can order a hot tub cover. The user selects a brand and then model. After selecting the model, dimensions for the model will appear. The dimensions will be default values inside of a textfield. Due to some variations in the spa models, the dimensions may not be correct so the user can correct the dimensions by typing in the correct value.

Here is a link to the form: www.spapalace.com/spa-cover-order-form

The important part is in step 2 in the dimesions section.

I tried using this code for the default values but it doesn't seem to work.

<?php
if ($jacuzzi_model=="j_325") {
return '84';
} elseif ($jacuzzi_model=="j_335") {
return '88';
} else {
return 'unselected';
}
?>

What am I doing wrong? Thanks.

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

Setting conditional default values for textfields 3 years 11 months ago #179232

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
Hi,

can you please send us your form so we can test it. Follow this steps to create a Form Pacakge:
crosstec.org/en/support/online-documenta...ted/94-packages.html

Zip it (.zip) and attach here.
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================

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

Last edit: Post by lovre.

Setting conditional default values for textfields 3 years 11 months ago #179271

  • Topic Author
  • sonstephen0
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 3
  • Thanks: 0
Ok, here is my form package.
Attachments:

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

Last edit: Post by sonstephen0.

Setting conditional default values for textfields 3 years 10 months ago #179312

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
Hi,

We are sending you back your form in a package. Just download the package, unzip and install via the package installer (BF> Configuration).

What we have done is removed the php code from the value field of the dimension_a field and created a "Change" Actionscript for your jacuzzi_model field (jacuzzi_model> Advanced> Actionscript> Custom> Check Change). The script looks like this:
function ff_jacuzzi_model_action(element, action)
{
if (element.value=="j_325")
{ff_getElementByName('dimension_a').value="84";}
else if (element.value=="j_335")
{ff_getElementByName('dimension_a').value="88";}
}

You can now add the rest of the model dimensions simply by adding more else if statements.
You should also do a similar change actionscript for your sundance_spas_model and strong_spas_model elements.

Hope this helps. Let us know if this is what you were talking about.
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================
Attachments:
The following user(s) said Thank You: sonstephen0

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

Setting conditional default values for textfields 3 years 10 months ago #179358

  • Topic Author
  • sonstephen0
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 3
  • Thanks: 0
Thank you for the help. I installed the package and added the rest of the models. Everything is working. Thank you.

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

Setting conditional default values for textfields 3 years 10 months ago #179367

  • lovre's Avatar
  • lovre
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2667
  • Karma: 76
  • Thanks: 329
That's great.

Let us know if you need further assistance.
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===========================================
Need to renew Pro Support?
Buy Here!
===========================================
Satisfied?
Consider a membership!
===========================================
Like us on Facebook
===========================================

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

Last edit: Post by lovre.
  • Page:
  • 1
Time to create page: 0.053 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

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!