• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Insert Javascript to count/limit words entered

Insert Javascript to count/limit words entered 16 years 8 months ago #4487

  • hearts
  • hearts's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Hi. I recently asked this question:

How do you limit the word count in a textarea field? We want a field where a user can enter a story with a maximum of 750 words. How do we limit the user to no more than 750 words?

I was told by Alex:

that can only be done with a javascript code. in the Additional attributes of the textarea field type onchange=yourControlFunction() and then define the javascript function. You can find such functions on google easily.

I googled javascript, found the code, and entered the \"onchange\" and the javascript code itself. However, once I enter javascript within my form, my form locks up. I cannot save, cannot apply, cannot preview, cannot cancel. I have to exit out and go back in to the form. Once I am in the field again, I still get the same results and basically have to recreate the form.

Can anyone tell me where and how to enter javascript on this form to accomplish my original goal?

Thanks!

Current \"messed-up\" form:

www.hearts-at-home.org/index.php?option=...=99999999&fid=15
The administrator has disabled public write access.

Re:Insert Javascript to count/limit words entered 16 years 8 months ago #4489

  • richiep
  • richiep's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 131
I suspect you have an error in your JavaScript. I think the type of script your looking for is this.

www.hscripts.com/scripts/JavaScript/word-count.php

Also you might want to read up on JavaScript
www.w3schools.com/JS/default.asp

Good luck
Richiep
The administrator has disabled public write access.

Re:Insert Javascript to count/limit words entered 16 years 8 months ago #4501

  • hearts
  • hearts's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
Actually, I don't think there is an error in the javascript - there is an error where and how I insert the javascript within the form in rsforme in joomla. Can you help?

I googled javascript, found the code, and entered the \"onchange\" and the javascript code itself. However, once I enter javascript within my form, my form locks up. I cannot save, cannot apply, cannot preview, cannot cancel. I have to exit out and go back in to the form. Once I am in the field again, I still get the same results and basically have to recreate the form.<br><br>Post edited by: hearts, at: 2008/08/28 18:42
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!