I need a help, because I don´t know where is a problem. I try to code max of input value, but I don´t want set exact number. I would like set up the max value as this: var body=$w( ‘#input7’ ).value;
$w( ‘#input5’ ).max=body;
the code should work fine. However, there are several points you need to pay attention to:
If you are defining the maximum characters that should be entered: use maxLength property (for text-type inputs);
If you want to define the maximum number that can be entered (for number-type inputs), use max property;
Make sure to capture the actual input7 value before defining the maximum of input5: if the value is dynamic: use input5 onChange, or onInput, or onBlur, or other event handlers.
Otherwise, if you use it in $w.onReady() function, it will always be 0 (because value is defined as soon as the page loads)
If you hard-code the input5 value, assign the value before setting up input7 (check the lines numbers).
Thank you for your help, I solved it. It was only about to put it to the right place in the code (I had it outside of onReady function, but not on the right place in rest of code).