I have a simple form here,
<?php echo form_open('moneyexchange/invest_first_page'); ?> <input id="amount" value="" type="text" placeholder="Amount in €" name="writtenamount"/> <button class="btn btn-lg" type="submit" id="yourbuttonid" >Invest</button> <button class="btn btn-lg" type="submit" id="yourbuttonid2">Borrow</button> <?php echo form_close();?>
What I want to do is on submit of each button, I want to change the path of the form, if I press submit on Invest button, it goes to this path
moneyexchange/invest_first_page , and I need it to change paths when I click the Borrow button, since I am using one input field for both. Right now it works only when I click invest. Do tell me in details steps please.
You can use jquery and do this.
Do the same for the other button, but in your script just change the id to yourbuttonid2