problem in multiple form validation bootstrap forms - javascript

i have at least two form in one page but all forms are dependent on the first form, The fields of the first form must be filled in order for the validation of the rest of the forms to work correctly.
what is problem?
my code: > link

Related

Use browser form validation without submission (JS / Jquery)

I am working on a multi part form that is composed of three views.
The user will have to fill the first part, click next, fill the second part, next again, the third part and finally submit the form.
However I would like to add validation to each part to ensure the user have filled all required fields before reaching the next part.
For simplicity and consistency with the rest of the website I would like to use the browser validation system, which is triggered at form submission by default.
Is there any way to use callback that detect invalid fields and highlight them when the form is submitted without a call to submit ?

How can I have one submit button for multiple forms?

I have tried to make one submit button submit multiple forms using the following resources:
https://www.daniweb.com/web-development/php/threads/255723/two-forms-one-submit-button-hw-does-it-work
https://forums.digitalpoint.com/threads/post-multiple-forms-with-a-single-button-press-with-javascript.2271691/
http://board.phpbuilder.com/showthread.php?10351103-submit-two-forms-with-one-button
When I use any of code from above, I can submit only one of my forms and its always the last one in the list of all form. I believe the problem could be that every form I have is in separate php file and I'm using include 'php/option-type.php' ; to include them in index.php where I also tested codes from above forum.
Combine both forms into one form, and then process the submitted data in a php script, which can then do both actions needed.
Can you give a little more information about the two forms, and what is each submit supposed to do? Then I'll be able to elaborate on my answer.

Combining 2 form actions into one form

I currently have two forms doing two separate actions.
One form subscribes a user to a mailchimp list. The other allows a user to submit their cv.
However I have two submit buttons, one for each action. I want to condense this down to just one submit.
Here is my jsfiddle: http://jsfiddle.net/GSVY8/
.
The end result should be that on submission the CV should be sent to me, and then the form for mailchimp should be submitted.
Any ideas would be much appreciated.
Cheers, Matt
You are using two different actions, so you need to different forms! Without the tag, the input button is useless anyway!
Validate the form in both client-side and server-side
So just wrap each submit button in a different form with a different action/validation and you're done!

Ruby On Rails Refresh Form Values

Hi I have a basic form in one of my Ruby On Rails views, it has an input tag and a placeholder. When I submit the form and then try to add another entry the values are kept from previously, what is the simplest way to clear the form fields after submitting. I guess I need to call some javascript onsubmit action when the form is submitted?
If someone could show me a simple example it would be great

submit all input elements on a page

Is there an easy way to submit all input elements on a page?
I have a very customisable page where the user can add and remove rows from multiple tables. The rows contain various different input elements. Do I have to put each table inside a form and then on submit have javascript to submit all the forms?
If you want to submit all input elements, it's sufficient to have only one <form> that encircles them all. Calling form.submit() from JS or with a classic submit button then catches all input fields.
If you want a dynamic selection by the user, let her put inputs inside the form element for submission and outside to keep them where they are. This can be achieved with JavaScript.
Just put one form on the page that contains all your tables and inputs and submit that – you cannot submit more than one form at a time.

Categories