document.orders is undefined because you have assigned the id orders to your form, not the name orders.
A form field is addressed as document.formname.elementname.value; or
There is not much point in assigning ids to form fields as only fields with a name can be passed to the server when the form is submitted.
Screen shots are of little use if you want us to run your code to diagnose errors. Post the actual (relevant) code (within code tags, please).
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Last edited by Philip M; 03-10-2012 at 05:19 PM..