<li class="fields">
        <div class="field">
            <label><?php echo $this->__('Annual Usage') ?></label>
            <div class="input-box">
            <input type='text' value="<?php echo $this->getValue('annual') ?>"
            name='customer[usage]' id='customer:usage' class="input-text"/>

I want to add two more form fields and append them to the submit with Javascript. How do I tie into the form submission?

  • did you ever get this sorted? – David Manners Feb 21 '15 at 13:25

Once you add additional field with in the <form> .. </form> tag they will automatically get appended to the form during submit (assuming that you are not manually add the form field to an ajax post/get).

But you may have to modify your php script to process that field (i.e save the field to the db)

  • Is there a way to hijack the form submission with javascript? I've inherited a site with a plugin that uses ioncube to mask some parts of the code. The customer relies on the plugin for lead generation so I dont want to strip it out just do some sort of onclick to piggyback on the submit and append it to the submission. It goes to a transactional email template. – Matthew McLennan Nov 17 '14 at 2:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.