Make Options already selected (in Link / URL?)

  • seppi
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 64
  • Thank you received: 1

seppi replied the topic: Make Options already selected (in Link / URL?)

That would be awesome! Actually this is something I wanted to know for a long time ;-)
#207513
  • MarioPuco
  • MarioPuco's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 5945
  • Karma: 118
  • Thank you received: 550

MarioPuco replied the topic: Make Options already selected (in Link / URL?)

Hi,

So let say you have a checkbox group element with 3 values in your "list" field :
0;Title 1;value1
0;Title 2;value2
0;Title 3;value3 

Each of these option will have it's own ID, which you can use later on so you can enable (check ) it.

var urlFrom = document.referrer;

switch(urlFrom) {

 case "http://your-url1.com":
  jQuery(document).ready(function(){
   document.getElementById("ff_elem21963").checked = true;
  });
 break;

 case "http://your-url2.com":
  jQuery(document).ready(function(){
   document.getElementById("ff_elem21963_1").checked = true;
  });
 break;

 case "your-url3.com":
  jQuery(document).ready(function(){
   document.getElementById("ff_elem21963_2").checked = true;
  });
 break;

And that's it.

Let me know if you need anything else.

Regards,
Mario

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#207523
Attachments:
The following user(s) said Thank You: seppi
  • seppi
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 64
  • Thank you received: 1

seppi replied the topic: Make Options already selected (in Link / URL?)

Yes! That's it!

Thanks again - have a great day!
#207528
  • MarioPuco
  • MarioPuco's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 5945
  • Karma: 118
  • Thank you received: 550

MarioPuco replied the topic: Make Options already selected (in Link / URL?)

Great !!

Regards,
Mario

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#207530
Moderators: ForumSupporttomeperica
Time to create page: 0.206 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here