Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

WYSIWYG validation

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 :

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).

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.

Look! It's Leonardo da Vinci! And he brought a tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic