You can do it in many ways:

1. Create an empty placeholder for hidden input (div at the bottom of your 
form). You can then easily replace content of this div and don't care about 
multiple inputs:

addElement: function () {
    $("totalsContainer").update('<input type="hidden" id="finaltons" 
value="' + totaltotal + '"></input>');

2. Create this hidden input in your form on server (in other words, input 
should always exist), then just replace its value:

addElement: function () {

3. Combine both ways: check for existence of element (if not exists - then 
create it), then update its value:

addElement: function () {
    var input = $("finaltons");
    if (!input) {
      input = new Element({type: "hidden", id: "finaltons"});

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To view this discussion on the web visit 
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to