Search code examples
phpajaxformsphplucidframe

Remove ajax from the form submission in PHPLucidFrame


I'm using PHPLucidFrame the version 1.1.1. I found that LucidFrame makes by default every form submission using ajax. Is there any way to create forms without using ajax? I just want to submit my forms with traditional HTTP request.


Solution

  • According to its documentation, you can simply add class="no-ajax" to the <form> tag.

    <form name="yourFormName" id="yourFormId" method="post" class="no-ajax">
        <div class="message error"></div>
        <!-- 
            HTML input elements here as usual 
        -->
        <?php Form::token(); ?>
    </form>
    <?php Form::respond('yourFormId', Validation::$errors); ?>
    

    If your form action handling is in the same page, the Form::respond() call will automatically display the error message into <div class="message error"></div> and highlight the error fields.