1
cbuehrle
XoopsFormTextArea Javascript Events
  • 2005/12/23 16:57

  • cbuehrle

  • Just popping in

  • Posts: 4

  • Since: 2005/12/23


I am creating a XoopsFormTextArea and adding it as an element to a form.

$techinfo_textarea = new XoopsFormTextArea("Technical Information: ""techinfo"""675);


I want to limit the amount of characters that are entered into the textarea to 1000 characters. I have a javascript function that I would normally call in the textarea tag like this:

<textarea onKeyDown=textCounter(this.form.description,1000)> textarea>


How would I call the javascript function when using the XoopsFormTextArea function?

2
wtravel
Re: XoopsFormTextArea Javascript Events

Hi,

You can try this:

$techinfo_textarea = new XoopsFormTextArea("Technical Information: ""techinfo"""675);
$techinfo_textarea->setExtra('onKeyDown=textCounter(this.form.description,1000)');


The setExtra option function allows you to add your custom parameters.

Best wishes

3
cbuehrle
Re: XoopsFormTextArea Javascript Events
  • 2005/12/23 18:00

  • cbuehrle

  • Just popping in

  • Posts: 4

  • Since: 2005/12/23


Oh I see. Thank you very much!

Where is the appropriate place to add javascript function? Should I append the include/xoops.js file or create a separate one per module?

4
wtravel
Re: XoopsFormTextArea Javascript Events

You can choose either way of course, if the javascript is only used in that module I'd create a custom .js file or just add it to the template, depending on the number of files I use the same js code in. The advantage of that over adding the custome script to xoops.js is that you do not need to bother about it in XOOPS upgrades

Login

Who's Online

321 user(s) are online (208 user(s) are browsing Support Forums)


Members: 0


Guests: 321


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits