value of one field depending on more select-fields

  • Posts: 265
  • Karma: 1
  • Thank you received: 31

Eddy.vh replied the topic: value of one field depending on more select-fields

Hallo.

So müsste es funktionieren !

Kannst du bitte das angehängte Formular bei dir installieren und Testen ?
#237464
Attachments:
  • Posts: 265
  • Karma: 1
  • Thank you received: 31

Eddy.vh replied the topic: value of one field depending on more select-fields

Hey.

Habe gerade etwas gemerkt.

Dein Code :
var val =JQuery('[name="ff_nm_selekt[]"]').val();

Muss aber so sein
var val =JQuery('[name="ff_nm_Selekt[]"]').val();

Die Namen in Skripten sind case-sensitiv !!! ;)
#237466
  • Mister.Miracle
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 87
  • Thank you received: 0

Mister.Miracle replied the topic: value of one field depending on more select-fields

Hi thank you for your advise :-)
now it works fine for one select-field.

2 questions:
1.)
is it possible to use a execute like this:
ff_getElementByName("SELEKT").hidden=false

2.) if i want a if-then-else-condition over more than one select-field...
on which position i should create the condition?
#237468
  • Mister.Miracle
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 87
  • Thank you received: 0

Mister.Miracle replied the topic: value of one field depending on more select-fields

okay.
i tried on my own a little bit :-)

i got more select-fields named:
- selekt1
- selekt2
- selekt3
- textfield1

now i expand your code a little bit, but it dont work, like i imagine :-(
...
//Condition for selekt!
if(val="SELEKT1_VALUE1") {
   ff_getElementByName("textfield1").value="myText1";
   ff_getElementByName("textfield1").readonly=true;
(...)
this code alone works fine.

now expanded to the selekt2
...
//Condition for selekt!
if(val="SELEKT2_VALUE1") {
   ff_getElementByName("textfield1").value="myTex3";
   ff_getElementByName("textfield1").readonly=true;
(...)

Now both dont change the value to textfield1 :-( Why?

after that...
i created a ff_getElementByName-Part to one of the conditions:
...
//Condition for selekt!
if(val="SELEKT1_VALUE1") {
   ff_getElementByName("textfield1").value="myText1";
   ff_getElementByName("textfield1").readonly=true;
   ff_getElementByName("selekt3").value="SELEKT3_VALUE2";
   ff_getElementByName("selekt3").readonly=true;
(...)
the element is set to SELEKT3_VALUE2 --> it works fine.
But... why it is not readonly? This part dont work :-(

Thank you for your advise :-)
#237482
  • Mister.Miracle
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 87
  • Thank you received: 0

Mister.Miracle replied the topic: value of one field depending on more select-fields

Nobody any idea, how to create the scipt to work with more than one select-fields and one text-field?
#237547
  • Posts: 2726
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: value of one field depending on more select-fields

Hello,

You can make a select list read-only using this function:
jQuery('[name="ff_nm_selekt3[]"]').attr("disabled", true);

Let me know whether this is working for you.

Regards,

Mihaela
#237558
Moderators: ForumSupporttomeperica
Time to create page: 0.070 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