I have a function that I want to call when presenting my Laravel Form for Ajax purposes. How to do this if the page does not submit and does not reload?
This works: (but Enter btn fails)
<?php echo Form::open(); ?> <?php echo Form::button('Search', array('id'=>'searchbtn', 'class'=>'button radius right', 'onclick'=>'myFunction(this.form)')); ?> <?php echo Form::close(); ?>
It does not mean:
<?php echo Form::open(array('onsubmit' => 'myFunction(this)')); ?> <?php echo Form::submit('Search', null, array('id'=>'searchbtn', 'class'=>'button radius right')); ?> <?php echo Form::close(); ?>
source share