"Allow add" option - mask fields

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
alex
User
Posts: 267

"Allow add" option - mask fields

Post by alex »

Hello, lets say I have table "orders" where I use jquery maskedinput for field "phone" (hkvforums.com/viewtopic.php?f=4&t=33719). Another table "orderDetails" has field "orderId" with "Allow add" option (adding records to table "orders").

I added code to table "orders": Client Scripts > Table Specific > Add/Copy Page > Startup Script

    $(document).ready(function(){
    $("#x_phone").mask("+7(999) 999-99-99");
    });

If I add record to table "Orders" then it works correctly but if I add record from table "orderDetails" using "Allow add" option then maskedinput doesn't work.

I also tried to add code to: Client Scripts > Global > Startup Script

but it didn't change its behavior - works from "Orders" but not from "orderDetails".

Please advise how to solve. (v2024.8)


mobhar
User
Posts: 11726

Post by mobhar »

In v2024, the Add Option Page has its own Startup Script, too.

So, you need to add it under: Client Scripts > Table Specific > Add Option Page > Startup Script


arbei
User
Posts: 9384

Post by arbei »

If you use Startup Script, you may remove the enclosing $(document).ready(function(){ and });.


alex
User
Posts: 267

Post by alex »

arbei wrote:

If you use Startup Script, you may remove the enclosing $(document).ready(function(){ and });.

I did and its still working. Thank you!


Post Reply