Forums

Javascript variable to chronoforms database

MicroMelody 02 Jan, 2009
Hi,

I have a Javascript to put users from one listbox to another. The listbox is part of a chronoform. How do I 'transfer' the javascript-variable with the selection (eg. "1,5,8") to the chronoform-table in mysql? I tried with input="hidden" etc. but It doesn't save the values in the chronoforms table.

Gr, Jan
GreyHead 02 Jan, 2009
Hi Jan,

I'm not quite sure what you are doing here - some code examples might help.

You should be able to set the value of a hidden field form your JavaScript so that it will be saved like any other form value.

Bob
MicroMelody 02 Jan, 2009
Hi Greyhound,

wow, you are for sure the quickest forumreplyer I know... fantastic!

I managed to create a <INPUT HIDDEN> statement with Javascript (sorry, now I see it) but one thing I don't understand: it writes it to a new page in stead of in the form code.

<...>

Sorry, I managed to solve this by creating a <div> and writing the code to it. Sorry, I was to quick by asking this at the forum!

Gr, Jan
GreyHead 02 Jan, 2009
Hi Jan,

Try the other way round - create a hidden input in your Form HTML then set it's value with the JavaScript.
<input name='new_var' id='new_var' type='hidden' value='' />
$('new_var').value = 'xyz';
Note: not tested and may need debugging.

Bob
This topic is locked and no more replies can be posted.