Tags:
create new tag
, view all tags

Question

Hi to all!!!

I have a question here regarding wiki words in html forms. I have a field and the user must supply a wiki word in that field. How do I check if the value supplied by the user is indeed a wiki word? Any javascript for this. If the word is not a wiki word, i could then prompt the user an alert that the value given is invalid. If not a javascript, how could I do that in an embedded html using an onsubmit event? Any ideas is greatly appreciated. Many Thanks!

Environment

TWiki version: TWikiRelease04Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms, Javascript

-- MartinJrAdane - 01 Aug 2006

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Look at the source of TWikiRegistration, it uses JavaScript to create a WikiWord out of the user name. You can leverage that for your WikiWord test.

-- PeterThoeny - 01 Sep 2006

The JavaScript file twiki.js that is distributed with TWiki 4 has a function to check for a wikiword: isWikiWord. See for example the latest WebTopicCreator where this script is being used to provide user feedback.

-- ArthurClemens - 01 Sep 2006

 
Topic revision: r4 - 01 Sep 2006 - 23:36:42 - ArthurClemens
Support.CheckingIfFieldValueIsAWikiWord moved from Support.CheckingifFieldValueisaWikiWord on 01 Aug 2006 - 22:41 by PeterThoeny - put it back
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback