When Multiple fields on Same form requires Onchange any Alternative for Onchange

grr
Kilo Contributor

Hello,

I have a requirement where there are 15 'A' fields A1 A2 A3 .....A15

in the Same way 15 'B' fields B1 B2 B3 ...B15

All these fields rely on same form, user needs to enter these fields and all are String fields which holds some numbers

A Fields must be greater than B.

if the user tries to give a B Value greater than A then it should alert and clear he value which he enters. This should be done Instantly. Cannot wait till submitting the form.

These fields may increase in future. It might be difficult to create those many Client Scripts.

I achieved this by using 30 Client Scripts but they need some alternative other than using these many Client Scripts...

Can Any one please suggest with some alternatives and help me out with this...

1 ACCEPTED SOLUTION

Not tried this myself I used the shared function option but may be of some help create an onchange event in an on load function.



http://www.snc-blog.com/2012/06/04/client-script-for-multiple-fields/


View solution in original post

5 REPLIES 5

MKelly83
Giga Expert

Hi grr



You could write a shared function in an onload client script then in all your onchange client scripts just call the function.



You will still have all the on change client script but will only ever need to update the function in one place.


grr
Kilo Contributor

Thank you For Quick Response Michelle,


Yeah but they don't even want to create those many client scripts it seems.


Not tried this myself I used the shared function option but may be of some help create an onchange event in an on load function.



http://www.snc-blog.com/2012/06/04/client-script-for-multiple-fields/


grr
Kilo Contributor

Thank you for providing me with this Article,



I tried this but in my case it is not working