Input field in a Grid ???

Hello,

How to add an input field into a grid application ?

ex : on displayed record line , adding a input of a value

Thanks

create a virtual field (virtual input).

Nope, that doesn’t work. You cannot add edit fields to a grid. If you need a grid with edit fields you need to create a form of type editable grid (view). Here you can add a manual field at fields -> newfield.

There is a way to meke something like this, but it is not native and i am not sure it will work for every purpose:

You can create a virtual text field, I created one called “teste”. And in the onRecord Event I did this:

{teste} = "
<form method=‘POST’>
<input type=‘text’ name=’".{id}."_field’ />
<input type=‘hidden’ name=‘post_submit_form’ value=’".{id}."’ />
<input type=‘submit’ />
</form>
[B]";

[/B]This code will create an input field with a submit button for every record. If i click the submit button it will reload the page and send the data via POST. On the onScriptInit event i have this:

if (isset($_POST[‘post_submit_form’]) && !empty($_POST[‘post_submit_form’]))
{
if (isset($_POST[$_POST[‘post_submit_form’].’_field’]) && !empty($_POST[$_POST[‘post_submit_form’].’_field’]))
{
$value = $_POST[$_POST[‘post_submit_form’].’_field’];
$id = $_POST[‘post_submit_form’];
/* YOUR CODE GOES HERE */

}
}

This will make me able to Use the value submited with the $value variable and the ID of the row affected with the $id.

Hope this can help you.

Thanks !!!

I will try your code Enrique :slight_smile:

Best regards

🚀 Scriptcase 9.12 is now available! Check out the new features here 👉🚀 Next Monday (02/24), Scriptcase 9.12 will be released! Check out the new features before anyone else 👉