TOPIC:

Line Count 7 months 3 weeks ago #238527

  • Topic Author
  • mrperfectpz
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 184
  • Thanks: 0
I would like to add a textarea next to a textarea that will give a number for entires into the textarea ie

1. Text
2. Text
3. Text
4. Text
5. Text

Etc, etc

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

Last edit: Post by mrperfectpz.

Line Count 7 months 2 weeks ago #238540

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

Please explain a bit more what exactly do you want to achieve because I'm not sure.

If you wish to add numbers in front of each line, copying values from textfield to textarea as explained here crosstec.org/en/forums/1-forums/126875-t...e-solved.html#238483 , I can give you further instructions based on this example.

Regards,

Mihaela

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

Line Count 7 months 2 weeks ago #238549

  • Topic Author
  • mrperfectpz
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 184
  • Thanks: 0
I have 2 textareas. I would like the first textarea to add a number for each entry into the other textarea. So it automatically adds a new number when new entry is added. ie.

textarea 1 Textarea 2

1 dfdsfdjfks
2 dsdfsdfsdf
3 sdfsdfsdfsd
4 dfsdfsdfsdf
5 fdsdfsdfsdf
etc

I hope this explains :)

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

Line Count 7 months 2 weeks ago #238553

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

I think that now I understand how you would like this to work.

To copy values from textarea1 to textarea2 and add an order number before, do as follows.
Go to the Advanced properties of the "textarea1" and in the "Actionscript" section set Type to Custom and Action to Change.
In the code area that appears below put the following code:
function ff_textarea1_action(element, action)
{  len = ff_getElementByName('textarea2').value.split(/\r\n|\r|\n/).length
    ff_getElementByName('textarea2').value = ff_getElementByName('textarea2').value + len + ". " + ff_getElementByName('textarea1').value + "\n" ; 
    ff_getElementByName('textarea1').value = "";
} // ff_textarea1_action
NOTE: In the code above replace "textarea1" withe the anme of first textarea and "textarea2" with the name of the second textarea.

Let me know whether this is working as you wanted.

Regards,

Mihaela

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

Line Count 7 months 2 weeks ago #238567

  • Topic Author
  • mrperfectpz
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 184
  • Thanks: 0
Hi

Thankyou for your work, but is there a way to place the numbers in 1 textarea and the values in another

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

Line Count 7 months 2 weeks ago #238569

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

Oh, you would like that each line which is added from TEXTFIELD passes text to one textarea and order numbers are added to a second textarea.
function ff_textfieldname_action(element, action)
{  
    ff_getElementByName('textarea1').value = ff_getElementByName('textarea1').value + ff_getElementByName('textfieldname').value + "\n" ; 
    ff_getElementByName('textfieldname').value = "";

    len = ff_getElementByName('textarea2').value.split(/\r\n|\r|\n/).length
    ff_getElementByName('textarea2').value =  len + "." + "\n" ; 

} // ff_textfieldname_action
Adjust the names of the elements and let me know whether it works.

Regards,

Mihaela

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.051 seconds

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!