7 years ago
5
Topic

Hi there,

I am trying to use plugin function to validate a dynamic select field and I don´t know why It simply don´t work on this kind of field. I tested the same plugin with a text field on the same form and It worked normally. 

Is this plugin not designed to work with dynamic select field?

Thanks in advance 

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
4
Level 1

What kind of validation are you trying to use?

7 years ago
3
Level 2

Hello Klas, 

Originally I was trying to compare values between two dynamic select fields. Then I tried the following function:

validapreco2 = function(){
var valorpreco2 = jQuery(this).attr(`est_preco2`).value;
var msg;
console.log("This is a test");
if ( valorpreco2 < 1000 ) {
msg="Valor menor do que 1000";
}
return msg;
}

As you can see I put a "console.log" in the middle of the function to see if it was been called, and the result in console is nothing.

Thanks in advance

4229 Posts
Kadministrator
7 years ago
2
Level 3

have you tried using this function on other field types? Are you calling validapreco2 somewhere?

7 years ago
1
Level 4

Hi,

If I use this same function on a text field It works normally. I tried It on a numeric select field and It didn´t work too.

I call validapreco2 function  using seblod validation on option 3 of content type.

Thanks

4229 Posts
Kadministrator
7 years ago
0
Level 5

I can confirm the problem, I made an issue for it https://github.com/Octopoos/SEBLOD/issues/431

Get a Book for SEBLOD