• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

Vidhya
 
author
Posts: 15385
6
  • 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.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic