I have a form which is shared by both the ADD and EDIT function. However, there is one area where if I am in the ADD mode, I will automatically check the checkbox and then I would like to auto submit the form. If I am in the EDIT mode, I can change the checkbox manually (ie uncheck the information) and then submit the changes myself.
My problem is that I am not able to auto-submit the form for the ADD mode.
My coding is something like this:
<form id="Schedule" action="<?php echo JRoute::_('index.php'); ?>" method="post">
<?php if (substr($this->params->get('page_title'),0,3) == "Add") :
<p>
<?php echo JText::_( 'I WILL GO' ).': '; ?>
<input type="checkbox" name="reg_check" CHECKED />
</p>
else : ?>
<p>
<?php echo JText::_( 'I WILL GO' ).': '; ?>
<input type="checkbox" name="reg_check" onclick="check(this, document.getElementById('el_send_attend'))" />
</p>
<?php endif; ?>
<p>
<input type="submit" id="el_send_attend" name="el_send_attend" value="<?php echo JText::_( 'REGISTER' ); ?>" disabled="disabled" />
</p>
<p>
<input type="hidden" name="rdid" value="<?php echo $this->row->did; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="task" value="userregister" />
</p>
</form>
What should I change to make the form auto-submit without clicking on the submit button when I am in the 'Add' mode?