Add value in server side script
Add value in server side script
Hello,
based on this example:
http://editor.datatables.net/examples/advanced/tableOnlyData.html
i'm trying to create a new record hiding a field in the form and then i would process the SQL insert with filled data + data passed in server side scrirpt.
Example:
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'users' )
->fields(
Field::inst( 'first_name' ),
Field::inst( 'last_name' ),
Field::inst( 'owner' )
->set( false )
->getFormatter( 'Format::date_sql_to_format', 'D, jS F Y' )
)
->process( $_POST )
->json();
Instead Formatter put my variable in some way:
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'users' )
->fields(
Field::inst( 'first_name' ),
Field::inst( 'last_name' ),
Field::inst( 'updated_date' )
which code to $_GET the variable???
)
->process( $_POST )
->json();
Thank you
Replies
I'm afraid I'm not understanding. You are sending both GET and POST data? That's okay, but I don't understand what you want to do with the extra value. Its an Editor field instance in your Javascript is it? If so, it is submitted as a normal field.
Allan
Simply in my form i would omit one field.
Right now i've 5 fields:
Name
Company
email
Description
Owner
I would like to omit "Owner" from form and pass to a query in server side retrieved by a $_Session variable already present in my php script.
This will permit the user to fill only the first fields and the 5th will be automatically inserted.
Hope i've clarified better
then then use _POST as before. If you would prefer not to modify _POST (possibly a good idea) just copy it to another variable.
Allan
Sorry but its not clear for me.
The behavior should e on create or edit actions.
So could you post me an example in order to work on it?
Thank you
Allan
Good...Thank you