Hello,
You can store this id in variable and use beforeSubmit event when the record is added. See the parameters passed to this event – i.e you can extend the posted data with this id.
Another approach is to have this field and fill it when the record is selected.
Some code you may get from our commertial componet here:
http://www.trirand.com/blog/phpjqgrid/examples/integrations/autocompl_sethidden/default.php
Regards
Tony