in reply to mechanize and javascript

Read the JavaScript code, look at what it does, and do the same from Mech. It probably just sets a field or two in the form, which is easy from Mech.