× Form Help

Edit options in Drop Down List

  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Aha, I see. Thank you very much Mihaela for all your support. I really appreciate it.

Best Regards,
Ante
#232508
  • Posts: 2433
  • Karma: 85
  • Thank you received: 331

mihaela replied the topic: Edit options in Drop Down List

Thank you for the kind words.

I'm glad I've helped. :)

Regards,

Mihaela
#232512
  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Hello again Mihaela.

Sorry, I thought I was done but I realized one more thing.

In the editable textArea you helped me create, can I make sure that there is no blanks on rows?
For instance if a user add "my test" to one row, it will automagically be "my_test" upon submit. Also if there is an empty space at start OR end of line, that empty space should be removed. " my test " -> "my_test"

Best,
Ante
#232515
  • Posts: 2433
  • Karma: 85
  • Thank you received: 331

mihaela replied the topic: Edit options in Drop Down List

Hello again,

What you want to do is achievable.

To remove the empty spaces at beginning and end of each line and to replace the spaces between words in a line with '_' you have to changethe code in End Submit.

So, go to form's Advanced properties > More options > Submit pieces and in End Submit section replace this piece of code:
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
    $opts.= "0;". $line .";". $line ."\n";
}
with this one:
foreach(preg_split("/((\r?\n)|(\r\n?))/", $test) as $line){
    $line = trim($line);
    $line = str_replace(' ', '_', $line);
    $opts.= "0;". $line .";". $line ."\n";
}
Actually, you have to add two lines of code.

Let me know whether after you do this everything works as wanted.

Regards,

Mihaela
#232561
  • ante
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 60
  • Thank you received: 0

ante replied the topic: Edit options in Drop Down List

Wow. Works perfect. Thanks.

Best regards,
Ante
#232600
  • Posts: 2433
  • Karma: 85
  • Thank you received: 331

mihaela replied the topic: Edit options in Drop Down List

Hello again,

I'm glad I've helped and that it works for you.

Regards,

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