netojose / laravel-bootstrap-4-forms

Bootstrap 4 forms for Laravel 5/6/7/8
MIT License
183 stars 58 forks source link

Multiple forms on a page #69

Closed 1e4 closed 5 years ago

1e4 commented 5 years ago

Hey,

I have multiple forms on a page, whenever I submit one, I get the validation for the other as well, is there anyway to avoid this other than having them on separate pages?

image

    <div class="card mb-3">
        <div class="card-header">
            Update your email
        </div>
        <div class="card-body">
            {!! Form::open()->route('account.email')->post() !!}
            {!! Form::text('email', 'New Email')->type('email') !!}
            <p>
                Upon updating your current email, your account will require validation before actions can be made
            </p>
            {!! Form::submit('Update Email') !!}
            {!! Form::close() !!}
        </div>
    </div>

    <div class="card">
        <div class="card-header">
            Update your Password
        </div>
        <div class="card-body">
            {!! Form::open()->route('account.password')->post() !!}
            {!! Form::text('new_password', 'New Password')->type('password') !!}
            {!! Form::text('new_password_confirmation', 'New Password Confirmation')->type('password') !!}
            {!! Form::text('current_password', 'Current Password')->type('password') !!}
            {!! Form::submit('Update Password') !!}
            {!! Form::close() !!}
        </div>
    </div>
netojose commented 5 years ago

Yes @1e4 , there is a way to fix this. Today I finished a new version of the package, and tomorrow I will update the documentation and put online. On the new version, there is a method can help you.

When I bump the new version, I will back here and tell you.

Thanks!

1e4 commented 5 years ago

Ah great, thanks so much. I currently moved them into separate tabs. Will move them back when the update is our. Love the package 👍

Cheers, Ian

On Fri, 21 Jun 2019, 01:18 José Neto, notifications@github.com wrote:

Yes @1e4 https://github.com/1e4 , there is a way to fix this. Today I finished a new version of the package, and tomorrow I will update the documentation and put online. On the new version, there is a method can help you.

When I bump the new version, I will back here and tell you.

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/netojose/laravel-bootstrap-4-forms/issues/69?email_source=notifications&email_token=AA427CWDJ35VRVATWZM6GHLP3QM53A5CNFSM4HZMQLW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYHCLHY#issuecomment-504243615, or mute the thread https://github.com/notifications/unsubscribe-auth/AA427CUMCONRT2RKSAUDG2DP3QM53ANCNFSM4HZMQLWQ .

netojose commented 5 years ago

@1e4 , new version is available, and now, you can have solve this using named error bags:

https://github.com/netojose/laravel-bootstrap-4-forms/tree/3.0.0#error-bag