Pre-populating an add form easily

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

Pre-populating an add form easily

Post by apis »

The following is the message i am getting when i do the as instructed in http://www.hkvforums.com/viewtopic.php?f=18&t=33045
would appreciate if you can let me know exect location where i can put the codes.

atal error: Uncaught Error: Call to undefined function get_mypost() in C:\xampp\htdocs\pos\quicksellgridcls.php:1133 Stack trace: #0 C:\xampp\htdocs\pos\quicksellgridcls.php(1275): cquicksell_grid->LoadDefaultValues() #1 C:\xampp\htdocs\pos\quicksellgridcls.php(1252): cquicksell_grid->NewRow() #2 C:\xampp\htdocs\pos\quicksellgrid.php(317): cquicksell_grid->LoadRowValues() #3 C:\xampp\htdocs\pos\cashregisteradd.php(1239): include_once('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\pos\quicksellgridcls.php on line 1133


mobhar
User
Posts: 11703

Post by mobhar »

Error "undefined function ..." means, you have not defined the function, yet. So make sure you have already put the "get_mypost" function in "Global Code" under "Server Events" -> "Global" -> "All Pages", afterwards regenerate at least the "userfn*.php" file.


apis
User
Posts: 124

Post by apis »

Mobhar, Thank you for your reply.

1)
I am not sure where exactly i have to put this code " get_mypost("barcode") " and whether i need to change anything here.

2)
here, do i need to change anything?

function get_mypost($val) {
if ( isset($POST[$val]) && strlen(trim(@$POST[$val])) > 0 ) {
return(trim(@$_POST[$val]));
} else {
return('');
}
}


arbei
User
Posts: 9359

Post by arbei »

The original post said:
In my global code section I created a custom function...

mobhar wrote:
So make sure you have already put the "get_mypost" function in "Global Code" under "Server Events" -> "Global" -> "All Pages", afterwards regenerate at least the "userfn*.php" file.

Double check you have placed your function definition in "Global Code" Server Event. Read Server Events and Client Scripts in the help file.


Post Reply