Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#825366
Hi guys,
I read the whole documentation about textbox fileds in dynaforms but i did not found any thing about how to set the minimum required length of textboxes.
Is there any way to set this constraint by extra options of textboxes in dynaforms or maybe some thing like a validate property or do i have to use javascript ?
Thank you in advance
#825389
In the validate property of the text field, you can use this regular expression to set a minimum of 10 characters:
^.{10,}$

And set this validation error message: Minimum of 10 characters
#826204
Hi again
I have another question related to using validation rules for text boxes.
Is it possible to use a validation rule for a text box to only accept numeric values between two numbers ? for example only between 0 and 100 ?
Thanks in advance
#826215
It depends on your range of numbers. Sometimes you can do it with regular expressions.

This will allow 0-100:
^(100|[1-9][0-9]|[0-9])$

This will allow 1-99:
^([1-9][0-9]|[1-9])$

However, if you have a complicated range, then you might need to use JavaScript like this:
Code: Select all
//set the minimum and maximum values (inclusive) allowed 
minVal = 284;
maxVal = 5839;

$("#amount").setOnchange(function(newVal, oldVal) {
    var iVal = parseInt(newVal);
    if (iVal < minVal || iVal > maxVal) {
        alert(newVal+" is outside permitted range between "+minVal+" and "+maxVal+".");
    }
});
Task doesnt have any users.

Amosbatto: One more thing if you can help me with.[…]

Just guide me to implement this?

Hi, I have a text control (rfq_segment) and I wan[…]

Genial!!! gracias. :D i need to translate an[…]