Hello again…
How to create a minLength function to control the characters in a field?
maxLenth exists, but minLength?
The XML
<item type="input" name="username" label="Username" inputWidth="150" required="true" validate="ValidNumeric" maxLength="6"/>
This is my script
var myForm;
function doOnLoad() {
myForm = new dhtmlXForm("formDataAndFees");
myForm.loadStruct("data.php");
myForm.attachEvent("onButtonClick", function(name) {
window[name]();
});
myForm.attachEvent("onAfterValidate", function(status){
if (status == true) {
myForm.send("data.save.php", "post", sendCallback, true);
}
});
}
// Validation
function doFormValidate() {
myForm.validate();
}
// Callback function for send
function sendCallback(r) {
document.location = "form.php?step=2";
}
Darya
#3
Hello
There is no native approach
You can try to use something like
validate: function(v){return String(v).length>=3;}