File: classWt_1_1WValidator.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (355 lines) | stat: -rw-r--r-- 24,326 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::WValidator Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="classWt_1_1WValidator.html">WValidator</a>
  </div>
</div>
<div class="contents">
<h1>Wt::WValidator Class Reference</h1><!-- doxytag: class="Wt::WValidator" --><!-- doxytag: inherits="Wt::WObject" -->A validator is used to validate user input according to pre-defined rules.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;Wt/WValidator&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Wt::WValidator:</div>
<div class="dynsection">
<p><center><img src="classWt_1_1WValidator__inherit__graph.png" border="0" usemap="#Wt_1_1WValidator__inherit__map" alt="Inheritance graph"></center>
<map name="Wt_1_1WValidator__inherit__map">
<area shape="rect" href="classWt_1_1WDateValidator.html" title="A validator for date input." alt="" coords="317,5,451,32"><area shape="rect" href="classWt_1_1WDoubleValidator.html" title="A validator for validating floating point user input." alt="" coords="311,56,457,83"><area shape="rect" href="classWt_1_1WIntValidator.html" title="A validator that validates integer user input." alt="" coords="323,107,445,133"><area shape="rect" href="classWt_1_1WLengthValidator.html" title="A validator that checks the string length of user input." alt="" coords="311,157,457,184"><area shape="rect" href="classWt_1_1WRegExpValidator.html" title="A validator that checks user input against a regular expression." alt="" coords="308,208,460,235"><area shape="rect" href="classWt_1_1WObject.html" title="A base class for objects that participate in the signal/slot system." alt="" coords="5,107,101,133"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classWt_1_1WValidator-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">State</a> { <a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3a5bf750faac5f1ca6fb58c8de97bac51">Invalid</a>, 
<a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a35e6ab5b841b3066a2d228b9ce7f4f447">InvalidEmpty</a>, 
<a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a31bc2acb7589ab9e3050867ebfc32dda3">Valid</a>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The state in which validated input can exist.  <a href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="81e355ed7c38c9e5de934d3994b3905c"></a><!-- doxytag: member="Wt::WValidator::WValidator" ref="81e355ed7c38c9e5de934d3994b3905c" args="(WObject *parent=0)" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#81e355ed7c38c9e5de934d3994b3905c">WValidator</a> (<a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new validator. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#4c4a0b7bcb4c543812b1500c748ab99b">WValidator</a> (bool mandatory, <a class="el" href="classWt_1_1WObject.html">WObject</a> *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a new validator.  <a href="#4c4a0b7bcb4c543812b1500c748ab99b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#d7f5599879175c310dac4b76331d7ff6">~WValidator</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#d7f5599879175c310dac4b76331d7ff6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#6f7993c51a0088b927d7c9aa516efabb">setMandatory</a> (bool how)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets if input is mandatory.  <a href="#6f7993c51a0088b927d7c9aa516efabb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8de913a10b24231264de5cc082c0d2fd"></a><!-- doxytag: member="Wt::WValidator::isMandatory" ref="8de913a10b24231264de5cc082c0d2fd" args="() const " -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#8de913a10b24231264de5cc082c0d2fd">isMandatory</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns if input is mandatory. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#bafa7c49159d5475a8ec6eff1fef8c17">setInvalidBlankText</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;text)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the message to display when a mandatory field is left blank.  <a href="#bafa7c49159d5475a8ec6eff1fef8c17"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#3518bfa063c9155c99e5ca3990465d35">invalidBlankText</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the message displayed when a mandatory field is left blank.  <a href="#3518bfa063c9155c99e5ca3990465d35"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#8766794c9600455d35cafb1bd9af1eb9">fixup</a> (<a class="el" href="classWt_1_1WString.html">WString</a> &amp;input) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This function attempts to change input to be valid according to the validator's rules.  <a href="#8766794c9600455d35cafb1bd9af1eb9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">State</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#fce53cf7c8fa1692234df0538163b4e0">validate</a> (<a class="el" href="classWt_1_1WString.html">WString</a> &amp;input) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Validates the given input.  <a href="#fce53cf7c8fa1692234df0538163b4e0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="cabfaf05f2346019f3f18f6c299bb384"></a><!-- doxytag: member="Wt::WValidator::createExtConfig" ref="cabfaf05f2346019f3f18f6c299bb384" args="(std::ostream &amp;config) const " -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#cabfaf05f2346019f3f18f6c299bb384">createExtConfig</a> (std::ostream &amp;config) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Provides Ext-compatible config options for client-side validation. <br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#5141a6c178329e6d26faad71e7bf26aa">javaScriptValidate</a> (const std::string &amp;jsRef) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates a Javascript expression that validates the input.  <a href="#5141a6c178329e6d26faad71e7bf26aa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WValidator.html#1ca29b7eaabf4c1655200ec382a84554">inputFilter</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns a regular expression that filters input.  <a href="#1ca29b7eaabf4c1655200ec382a84554"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A validator is used to validate user input according to pre-defined rules. 
<p>
A validator may be associated with a form widget using <a class="el" href="classWt_1_1WFormWidget.html#a773d16013d6959149ce5081e84b259c" title="Sets a validator for this field.">WFormWidget::setValidator()</a>.<p>
The validator validates the user input. A validator may have a split implementation to provide both validation at the client-side (which gives instant feed-back to the user while editing), and server-side validation (to be sure that the client was not tampered with). The feed-back given by (client-side and server-side) validation is reflected in the style class of the form field: a style class of <code>Wt-invalid</code> is set for a field that is invalid.<p>
This WValidator only checks that mandatory fields are not empty. This class is reimplemented in <a class="el" href="classWt_1_1WDateValidator.html" title="A validator for date input.">WDateValidator</a>, <a class="el" href="classWt_1_1WIntValidator.html" title="A validator that validates integer user input.">WIntValidator</a>, <a class="el" href="classWt_1_1WDoubleValidator.html" title="A validator for validating floating point user input.">WDoubleValidator</a>, <a class="el" href="classWt_1_1WLengthValidator.html" title="A validator that checks the string length of user input.">WLengthValidator</a> and <a class="el" href="classWt_1_1WRegExpValidator.html" title="A validator that checks user input against a regular expression.">WRegExpValidator</a>. All these validators provibe both client-side and server-side validation.<p>
If these validators are not suitable, you can inherit from this class, and provide a suitable implementation to <a class="el" href="classWt_1_1WValidator.html#fce53cf7c8fa1692234df0538163b4e0" title="Validates the given input.">validate()</a> which does the server-side validation. If you want to provide client-side validation for your own validator, you may also reimplement <a class="el" href="classWt_1_1WValidator.html#5141a6c178329e6d26faad71e7bf26aa" title="Creates a Javascript expression that validates the input.">javaScriptValidate()</a>.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WFormWidget.html" title="An abstract widget that corresponds to an HTML form element.">WFormWidget</a> </dd></dl>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="638a1feefca259ea2f806a8add2d18a3"></a><!-- doxytag: member="Wt::WValidator::State" ref="638a1feefca259ea2f806a8add2d18a3" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">Wt::WValidator::State</a>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The state in which validated input can exist. 
<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="638a1feefca259ea2f806a8add2d18a3a5bf750faac5f1ca6fb58c8de97bac51"></a><!-- doxytag: member="Invalid" ref="638a1feefca259ea2f806a8add2d18a3a5bf750faac5f1ca6fb58c8de97bac51" args="" -->Invalid</em>&nbsp;</td><td>
The input is invalid. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="638a1feefca259ea2f806a8add2d18a35e6ab5b841b3066a2d228b9ce7f4f447"></a><!-- doxytag: member="InvalidEmpty" ref="638a1feefca259ea2f806a8add2d18a35e6ab5b841b3066a2d228b9ce7f4f447" args="" -->InvalidEmpty</em>&nbsp;</td><td>
The input is invalid (emtpy and mandatory). </td></tr>
<tr><td valign="top"><em><a class="anchor" name="638a1feefca259ea2f806a8add2d18a31bc2acb7589ab9e3050867ebfc32dda3"></a><!-- doxytag: member="Valid" ref="638a1feefca259ea2f806a8add2d18a31bc2acb7589ab9e3050867ebfc32dda3" args="" -->Valid</em>&nbsp;</td><td>
The input is valid. </td></tr>
</table>
</dl>

</div>
</div><p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="4c4a0b7bcb4c543812b1500c748ab99b"></a><!-- doxytag: member="Wt::WValidator::WValidator" ref="4c4a0b7bcb4c543812b1500c748ab99b" args="(bool mandatory, WObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::WValidator::WValidator           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>mandatory</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classWt_1_1WObject.html">WObject</a> *&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creates a new validator. 
<p>
Indicate whether input is mandatory.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WValidator.html#6f7993c51a0088b927d7c9aa516efabb" title="Sets if input is mandatory.">setMandatory(bool)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="d7f5599879175c310dac4b76331d7ff6"></a><!-- doxytag: member="Wt::WValidator::~WValidator" ref="d7f5599879175c310dac4b76331d7ff6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Wt::WValidator::~WValidator           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>
The validator automatically removes itself from all formfields to which it was associated. 
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="6f7993c51a0088b927d7c9aa516efabb"></a><!-- doxytag: member="Wt::WValidator::setMandatory" ref="6f7993c51a0088b927d7c9aa516efabb" args="(bool how)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WValidator::setMandatory           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>how</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets if input is mandatory. 
<p>
When an input is not mandatory, then an empty field is always valid. 
</div>
</div><p>
<a class="anchor" name="bafa7c49159d5475a8ec6eff1fef8c17"></a><!-- doxytag: member="Wt::WValidator::setInvalidBlankText" ref="bafa7c49159d5475a8ec6eff1fef8c17" args="(const WString &amp;text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WValidator::setInvalidBlankText           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>text</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the message to display when a mandatory field is left blank. 
<p>
The default value is "This field cannot be empty". 
</div>
</div><p>
<a class="anchor" name="3518bfa063c9155c99e5ca3990465d35"></a><!-- doxytag: member="Wt::WValidator::invalidBlankText" ref="3518bfa063c9155c99e5ca3990465d35" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WValidator::invalidBlankText           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the message displayed when a mandatory field is left blank. 
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WValidator.html#bafa7c49159d5475a8ec6eff1fef8c17" title="Sets the message to display when a mandatory field is left blank.">setInvalidBlankText(const WString&amp;)</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="8766794c9600455d35cafb1bd9af1eb9"></a><!-- doxytag: member="Wt::WValidator::fixup" ref="8766794c9600455d35cafb1bd9af1eb9" args="(WString &amp;input) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Wt::WValidator::fixup           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>input</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This function attempts to change input to be valid according to the validator's rules. 
<p>
In general the function needs not to change the input into a valid input. The default implementation does nothing. But it may help the user in getting its input right. 
</div>
</div><p>
<a class="anchor" name="fce53cf7c8fa1692234df0538163b4e0"></a><!-- doxytag: member="Wt::WValidator::validate" ref="fce53cf7c8fa1692234df0538163b4e0" args="(WString &amp;input) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classWt_1_1WValidator.html#638a1feefca259ea2f806a8add2d18a3">WValidator::State</a> Wt::WValidator::validate           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classWt_1_1WString.html">WString</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>input</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Validates the given input. 
<p>
This function returns the current validation state of the input. The default implementation only checks whether a mandatory field is not left blank. 
<p>Reimplemented in <a class="el" href="classWt_1_1WDateValidator.html#fa833f63a53d7d13aecdf2f79dab75d9">Wt::WDateValidator</a>, <a class="el" href="classWt_1_1WDoubleValidator.html#66e68bb1d7f9698f3d515b1de884a33a">Wt::WDoubleValidator</a>, <a class="el" href="classWt_1_1WIntValidator.html#15807b522c601992d5275a729ed69285">Wt::WIntValidator</a>, <a class="el" href="classWt_1_1WLengthValidator.html#de2cb48af62ad35c7d7e50155fbf0e45">Wt::WLengthValidator</a>, and <a class="el" href="classWt_1_1WRegExpValidator.html#cd0bc1ff9dc23f4f34c6840e3d0d5edc">Wt::WRegExpValidator</a>.</p>

</div>
</div><p>
<a class="anchor" name="5141a6c178329e6d26faad71e7bf26aa"></a><!-- doxytag: member="Wt::WValidator::javaScriptValidate" ref="5141a6c178329e6d26faad71e7bf26aa" args="(const std::string &amp;jsRef) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Wt::WValidator::javaScriptValidate           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>jsRef</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Creates a Javascript expression that validates the input. 
<p>
The JavaScript expression should evaluate to an object with two fields: a boolean <em>valid</em>, and a <code>message</code> that indicates the problem if not valid.<p>
Return an empty string if you are not provide the client-side validation.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WValidator.html#1ca29b7eaabf4c1655200ec382a84554" title="Returns a regular expression that filters input.">inputFilter()</a> </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WDateValidator.html#de82d221d04556f2d219d1b9b80bce45">Wt::WDateValidator</a>, <a class="el" href="classWt_1_1WDoubleValidator.html#590267f8600a399b07133da5cec299b4">Wt::WDoubleValidator</a>, <a class="el" href="classWt_1_1WIntValidator.html#61217a65efb5d2e06262e3710224ea46">Wt::WIntValidator</a>, <a class="el" href="classWt_1_1WLengthValidator.html#2e8143bc9dedb9d4f7f77f3048bf5ff9">Wt::WLengthValidator</a>, and <a class="el" href="classWt_1_1WRegExpValidator.html#ae5e8bce20a76f654cd007b8b85cba0d">Wt::WRegExpValidator</a>.</p>

</div>
</div><p>
<a class="anchor" name="1ca29b7eaabf4c1655200ec382a84554"></a><!-- doxytag: member="Wt::WValidator::inputFilter" ref="1ca29b7eaabf4c1655200ec382a84554" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Wt::WValidator::inputFilter           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns a regular expression that filters input. 
<p>
The returned regular expression is used to filter keys presses. The regular expression should accept valid single characters.<p>
For details on valid regular expressions, see <a class="el" href="classWt_1_1WRegExpValidator.html" title="A validator that checks user input against a regular expression.">WRegExpValidator</a>. As an example, "[0-9]" would only accept numbers as valid input.<p>
The default implementation returns an empty string, which does not filter any input.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WValidator.html#5141a6c178329e6d26faad71e7bf26aa" title="Creates a Javascript expression that validates the input.">javaScriptValidate()</a> </dd></dl>

<p>Reimplemented in <a class="el" href="classWt_1_1WIntValidator.html#aa26351e1a00502da10a9d67a7eea817">Wt::WIntValidator</a>.</p>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:08 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>