• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

WYSIWYG validation

Vidhya Ramaswamy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using WYSIWYG control in my form (Source : http://www.openwebware.com)

I want to validate the data in the control using javascript and check for null/blank/multiple blank spaces.

The control accepts multiple blank spaces. I need help to validate this.
1. I tried using regex - "/^(\s+)$/" to check for multiple spaces directly on the 'message' variable.
2. Tried using WYSIWYG.removeFormat() - removes all HTML formatting, and multiple spaces are replaced with a single space) and then checked for occurence of a single space.

But, nothing seems to work. Regex does not work with WYSIWYG control, nor does checking for a space. Is there a way to get this working?
Also, the control's innerHTML's length for a single space is 7 characters(after truncating multiple spaces).

Eric Pascarello
Posts: 15385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you contacted the author of the control and see what they said?

Did you look to see what is in the innerHTML? alert(escape(plain_message)); might help.

When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic