Hi there,
I am just about to discover nubuilder and are stuck now because I want to run a procedure by clicking on a field in a browse form. I'm using custom code of the textbox in object view. There is no action, however simple, when clicking on the field.
Can the onclick event be used on a textbox ? Or only buttons ? Or what other type of objects ?
If there is a way, how can I pass a parameter to the PHP procedure (nuRunPhpHiddenWithParameters)
Txs for your help
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Trap onclick event from Textbox
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Trap onclick event from Textbox
nuSelectBrowse() runs when any record on a Browse Form is selected.
And here's a simple example how to use nuRunPHPHiddenWithParams().
In JavaScript:
The function runProc() calls the nuRunPHPHiddenWithParams() function with three arguments:
- 'myproc': a string indicating the name of the PHP procedure to be executed.
- 'myparams': a string representing the a Hash Cookie to be passed to the PHP procedure.
{activity: '111', task: '222'}: an object that contains additional parameters to be passed to the PHP procedure.
Add a Procedure:
And here's a simple example how to use nuRunPHPHiddenWithParams().
In JavaScript:
The function runProc() calls the nuRunPHPHiddenWithParams() function with three arguments:
- 'myproc': a string indicating the name of the PHP procedure to be executed.
- 'myparams': a string representing the a Hash Cookie to be passed to the PHP procedure.
{activity: '111', task: '222'}: an object that contains additional parameters to be passed to the PHP procedure.
Code: Select all
function runProc() {
nuRunPHPHiddenWithParams('myproc', 'myparams', {
activity: '111',
task: 'something'
});
}
Code: Select all
$myparams = nuGetProperty('myparams'); // Retrieve the Hash Cookie
if ($myparams) {
$myparams = json_decode(base64_decode($myparams)); // Decode it
$activity = $myparams->activity; // Retrieve the parameters
$task = $myparams->task;
// Output du nuDebug Results
nuDebug($activity, $task);
}
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4581
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 536 times
- Contact:
Re: Trap onclick event from Textbox
Hi,
Could you please let me know if my answer helped and if you were able to get it to work? I would greatly appreciate any feedback you can provide. Thank you!
Could you please let me know if my answer helped and if you were able to get it to work? I would greatly appreciate any feedback you can provide. Thank you!