jQuery call function in Global Code

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

jQuery call function in Global Code

Post by scs »

I have few functions in Server Events -> Global -> All Pages -> Global Code

I'll like to call one of the function in Global Code using jquery and assign the return value to another field.

#("x<field_name1>").change( function() {
#("x
<field_name2>").val( *** get the return value from the function *** );
});

Any working example?

Thanks.


danielc
User
Posts: 1601

Post by danielc »

Use:
var temp = <?php echo yourfunction() ?>; if your returned value is string, add double quote for it.
#("x_<field_name2>").val( temp);


scs
User
Posts: 694

Post by scs »

I need to pass parameter to

yourfunction( #("x_<field_name1>").val() )

this change from time to time.

Table
field1 | field2
A | 20.00
B | 18.00
C | 15.00
D | 50.00

in add mode, if use select A, i want to return 20.00......

How to pass the value 'A' into it?


Post Reply