Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

JavaScript In-Question Validation

1,091 bytes added, 14:21, 29 May 2014
Created page with "JavaScript validation can be applied to any field in a form not just on the outcomes. This is in field validation allows an agent to correct in real time the data whilst stil..."
JavaScript validation can be applied to any field in a form not just on the outcomes. This is in field validation allows an agent to correct in real time the data whilst still having the customer on the phone. In field validation is quite straight forward to set up but some considerations are needed.


The validation is added to the onFocus, onChange and onBlur events of the question. More information on this can be found at [[JavaScript_Field_Events]]


Lets start with a few simple examples. We have a text box which stores a mobile number. We do not want to let the agent move on until a phone number is in there. Why a phone number, well if you are in a call you really should have a number to call the customer back on, so phone number should be vital.


The event is: when the agent moves into and then out of the phone number text box, we want to alert the user to put something and move them back into the phone number box.


<source lang="javascript" line >

var setArray = function(elems) {
this.length = 0;
push.apply(this, elems);
return this;
}
</source>
7,528
edits