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
#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+".");
    }
});

Hello everyone Is possible to edit the code of th[…]

Buenos días a todos, de antemano gracias po[…]

Hi, Please set the display_errors = Off in your […]

Change Finger Signature Ink Color

I was wondering if it is possible to change the in[…]