Login Register

ValidationTextBox

onKeyPress doesnt work on ValidationTextBox

The onKeyPress event doesnt seem to when typing in the ValidationTextBox.

I need to check whether the text box is empty so that I can enable/disable a button.

Any ideas on how to get his working. This is the html I use ...

" trim="true" type="text" name="car_name_new" id="car_name_new" onKeyPress="newVehicle_CheckAllFields();"/>

The newVehicle_CheckAllFields() function is also fired on onChange for a FilteringSelect which works fine.

Have tried it on FF3 and IE7.

Textfields where property name contains an apostrophe

It seems that dojo has a hard time attaching a dijit to a textfield whose name property contains an apostrophe...

As I am using Struts2 (that relies on OGNL), a property backed by a Map might look like this:

<input type="text" name="countryName['en']" id="countryInEnglish" />

If I try to attach a dijit.form.ValidationTextBox to that node, dojo turns the name property into: ""

Is there a way of preserving the name of the property as I intend it?

(I tried escaping the apostrophe, to no avail.)

onChange does not get triggered if TextBox has errors

I have a subclass of ValidationTextBox where I override the onChange-function. The problem is that it doesn't get triggered if there is a validation error.

Lets say I have a field that is required and the value of the field is "a". If I change it to "b" and switches focus to another field, onChange gets executed, but if I remove the "b" and switches focus then onChange does not get executed and instead a validation error is displayed.

onChange: function(newValue) {

ValidationTextBox regExpGen not a function error (sorry about double post! don't know why it did that)

Hey everyone,

I am running into an issue dealing with the regExpGen tag of the dijit.form.ValidationTextBox inside a custom widget.

Basically, I create an entry in the template:

...

Input:

ValidationTextBox regExpGen not a function error.

Hey everyone,

I am running into an issue dealing with the regExpGen tag of the dijit.form.ValidationTextBox inside a custom widget.

Basically, I create an entry in the template:

...

Input:

Unable to validate a *TextBox

Hello ! :)

Do you know why I can't have a focus with the error message displayed on a *TextBox element (ValidationTextBox, CurrencyTextBox, etc) to validate it ?
when I try dijit.byId ('myElt').validate (true), or .isValid (true), .getErrorMessage (true), .getPromptMessage (true), nothing works !

The only thing that can be used is to set the focus to the specified element, and set the focus to another element, that will display the warning image, but without the prompt message.

It's tricky and not completly functionnal

Do you have a solution for me please ? :)

How do you make dijit.Editor a required form field ?

Any way to make dijit.Editor form elements "required" ? Have it trigger an invalidMessage call if nothing is entered ?

i.e. like validationTextBox ?

required="true"
invalidMessage="Please enter a value."

I can write my own form validation script for just this one field, but since I am already using validationTextBox it would be nice to have all the validation messages on the form look the same.

Show all required form fields ?

I have several ValidationTextBox fields in a form where the attribute 'required' is set to true.

Example:

<input   name='Name' id='Name'   type='text' dojoType='dijit.form.ValidationTextBox' required='true'  invalidMessage='Name is Required.  Length must be <=40 chars.' regExp='.{1,40}'   value=""  />

They all work fine on validating the fields on form submit -BUT- I need to show the users which fields are required *prior* to submitting the form.

Validation Text Box and Submit button dynamically enabled/disabled

Hey everyone,

I am trying to make a Button dijit that is linked to a ValidationTextBox that becomes enabled/disabled dynamically (on the fly, however you want to put it) when the input that is entered in the ValidationTextBox is in fact validated. For example, I have my ValidationTextBox:

<span style="position:relative;font-size: big;width:300px">
<input type="text" dojoType="dijit.form.ValidationTextBox"
id="origAddr"
regExp="\d{10}"
invalidMessage="Invalid phone address">
</span><BR>

and my Button:

[ValidationTextBox] - How to Show the Prompt Error Message ?

Hi !
I have a understandable problem on dojo and I believe you can help me.

I use a ValidationTextBox, and when the user click on the submit button, I check all the elements into a function.

In this function I do dijit.byId('myElt').isValid (true) and if it's not valid, I would like to display the prompt message.

Syndicate content