Form Help

TOPIC:

Automatically select a list option if… 1 year 8 months ago #233416

  • Eddy.vh's Avatar Topic Author
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 426
  • Karma: 4
  • Thanks: 69
Hello.

I have a classic form with some items including a hidden list.
I inserted a script that will display the list and hide another field only if the user comes from a specific URL. Everything works but I miss a detail.

list1 =
0;Sélectionnez une option;
0;Title 1;value1
0;Title 2;value2
0;Title 3;value3

I would like the "value2" to be loaded in the list when I arrive from the referring url.
What should I add to this script?
function ff_gd_liste_conditionnelle_init()
{
var urlFrom = document.referrer;
ff_getElementByName('url').value = urlFrom;

if (urlFrom == "https://www.referent-url.com/my-list") {
bfToggleFields('on','element','list1',bfDeactivateField); //that's ok
bfToggleFields('off','element','show_list',bfDeactivateField); //that's ok

}
}

Thank you for any help in solving this little problem.

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

Automatically select a list option if… 1 year 8 months ago #233418

  • Eddy.vh's Avatar Topic Author
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 426
  • Karma: 4
  • Thanks: 69
I just found the solution !
ff_getElementByName('list1').selectedIndex= 2;

:):P

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

Automatically select a list option if… 1 year 8 months ago #233419

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

I'm glad that you've managed to find the solution to this.

Regards,

Mihaela

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

Automatically select a list option if… 1 year 8 months ago #233421

  • Eddy.vh's Avatar Topic Author
  • Eddy.vh
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 426
  • Karma: 4
  • Thanks: 69
Hi Mihaela.

The answer came quickly after asking my question.
Some tests and I found the solution.

Best regards.
__
Eddy

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.048 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!