I have a form with around 500 lines of code and using codeigniter php method, and I have this drop down menu which needs the form to be submitted for the function inside the drop down menu to work.
This is the drop down menu which uses js to open up and submit a picture
<div class="form-group">
<label class="col-md-4 control-label "><?php echo lang("id_document");?></label>
<div class="col-md-6 tableCA1 ">
<div class="input-group-btn">
<button type="button" class="btn certificatebtn btnwithAmazingbrdr " data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <?php echo lang("add_cert");?>
<span class="glyphicon glyphicon-paperclip" id="pushingPaperClip"></span>
</button>
<ul class="dropdown-menu text-left">
<li><a href="#" data-bind="click: showModalAddId"><?php echo lang("myprofile_riskrating_add_certificate"); ?></a></li>
<li><a href="#" data-bind="click: showModalShowId"><?php echo lang("myprofile_riskrating_show_certificate"); ?></a></li>
<li><a href="#" data-bind="visible: userIsImpersonated(), click: showModalUserValidation"><?php echo lang("myprofile_riskrating_verify_certificate"); ?></a></li>
</ul>
<!-- <img width='34' height='34' id = "myid" data-bind="popUp: {tocall: $root.showModalShowPicture}" /> -->
</div>
</div>
</div>
but I have a error for submitting the picture since the form is not submitted. What I want to do is submit the form which includes name , birthday, etc, and open this drop down model at the same time, but without reloading the page on submit so the drop down menu open. I know AJAX is a way of doing it but I have way to many code in php to write them again in ajax, and will have to change a lot of things in controller since I am using codeigniter.
This is how the form is being submitted.
/* form-horizontal */
$attributes = array("class" => "form-horizontal", "id" => "register_form");
if (isset($_SESSION['login']))
{
if ($_SESSION['login'] == 'DoBusinessPerformed' || $_SESSION['login'] == 'NormalPerformed') {
echo form_open('myprofile/ManageProcessNew/'.$pathName, $attributes);
} else {
echo form_open('myprofile/RegisterProcessNew/'.$pathName, $attributes);
}
}
else
{
echo form_open('myprofile/RegisterProcessNew/'.$pathName, $attributes);
}
So is there anyway I can submit the form on the background if I click the drop down button.