Dynamic hidden field problem

Dynamic hidden field problem

Hi!

This doesn't work, the dynamic hidden field will be submitted as "". I have tested this in Firebug, inserts the hidden field correctly in DOM. VERSION gets submitted ok, STAMP won't. Am I missing something here?? Shouldn't this be elementary stuff??
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>



     <script type="text/javascript">                                        
           $(document).ready(function(){
               
                 $('#checkout_form').submit(function() {
                    
                     $.post("data_handler.php", {mode: "generate_stamp"}, function(xmldata){
                       
                         var stamp = $(xmldata).find("stamp").text();  
                          
                         $('#checkout_form').append('<input type="hidden" name="STAMP" value="' +stamp+ '"></input>');  
                      
                     });
                          
                     return true;           
                 });  
                
                 
           });
                                                        
     </script>




    </head>
    <body>

         <table><tr><td style="width:100%;">
       
         <form id="checkout_form" action="someaction.php" method="post" style="text-align: center;"></br>
        
             <input type="image" name="koodi_submit" id="jatka_submit" class="jatka_submitc" src="somepic.gif" value="Continue"></input>
             <input type="hidden" name="VERSION" value="0003"></input>     
         </form>
         </td></tr>
         </table>           
    </body>

    </html>