The values remain stored in memory even after closing the dialog, but are replaced when another dialog is opened, because SAMP does not support multiple dialogs.
So, you don't need to get the id in client-side, but if you still want to, SAMPFUNCS provides some opcodes for that:
0B4E: samp 1@ =...