Hello everyone, I want to pass $bean->id value of Case module to a javascript variable in view.edit.php file of "Case" module. I want to know, whether it is possible without using AJAX and if it is, then I would like to know, HOW TO?
Hey mike, sorry I mistakenly wrote $bean->id. I want to retrieve id of relate field account and using that id I want to retrieve all field of that account and from that I want to use type of that account and store that in javascript variable. Example:
$oAccount = new Account(); $oAccount->retrieve($bean->accounts_cases_1_name); $type_of_account = $oAcccount->type;
And I want to use value of $type_of_account in javascript variable. Is it possible?
The other possible option depending what you actually need is to do the call in view.edit then store the information in hidden fields created in editviewdefs
Hi, If js you are writing in view.edit.php you can assign the value $type_of_account directly to a javascript varible.
$script=<<EOC <script type="text/javascript"> //here we can use the $type_of_account variable directly var account_type='$type_of_account '; </script> EOC;
$script=<<EOC <script type="text/javascript"> //here we can use the $type_of_account variable directly var account_type='$type_of_account '; </script> EOC;
echo $script variable after parent::display(); method in the view.edit.php file
if I am using that javascript variable in alert function, it doesn't show me that value of php variable after assigning php variable to javascript variable. This my script
$script=<<EOC <script type="text/javascript"> var bn='$bean'; alert(bn); </script> EOC;