Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firemodal validation #61

Open
nandhini-ecrubit opened this issue May 28, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@nandhini-ecrubit
Copy link

commented May 28, 2019

Hi there! I'm new to this setup. Please tell me how to do a form validation in Firemodal function

@nauvalazhar

This comment has been minimized.

Copy link
Member

commented May 28, 2019

Hi, what form validation do you mean?

@nandhini-ecrubit

This comment has been minimized.

Copy link
Author

commented May 28, 2019

In Modal Login form validation

@nauvalazhar

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Do you want to validate the form in .fireModal()?

@nandhini-ecrubit

This comment has been minimized.

Copy link
Author

commented May 29, 2019

yes. I want to validate the form in .fireModal()

@nauvalazhar

This comment has been minimized.

Copy link
Member

commented May 29, 2019

You can validate the form fields with submit callback. https://docs.getstisla.com/#/en/2.2.0/javascript/modal

@nandhini-ecrubit

This comment has been minimized.

Copy link
Author

commented Jun 7, 2019

I've added a basic validation. the first alert shows twice, when i click OK the form submitted without validating other fields. Below is the code i used. Please tell me how to proceed further
$("#modal-add-expense").fireModal({ title: 'Add Expense', footerClass: 'bg-whitesmoke', body: $("#modal-add-expense-part"), autoFocus: false, onFormSubmit:function(modal) { var ex_date = $('#add_ex_date').val(); var ex_item = $('#add_ex_item').val(); var ex_amt = $('#add_ex_amt').val(); if (ex_date == '') { alert('Please Selet date!'); return false; } else if (ex_item == '') { alert('Please provide Expense Item!'); return false; } else if(ex_amt == ''){ alert('Please provide Expense Amount!'); return false; } }, });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.