Did you like how we did? Rate your experience!

Rated 4.5 out of 5 stars by our customers 561

Video instructions and help with filling out and completing When 8850 Form Submission

Instructions and Help about When 8850 Form Submission

Hi you want to know how to submit a form of JavaScript how to process the data I will show you we have a simple form with one input full name and one submit button let's try to write some data if I submit a form its refresh where browser is refreshed and I can see full name and value javascript has on submit event for the form we can define it like on submit a tribute and my function of my code here are free ways how to do it first is this one this attribute and second one is object not on submit and your function this is my favorite one and the third one is object dot and even listener on submit and my screen we will do the second one let's write a script after your form and before your body so you can select our form select this get the command by ID get element by ID name form this is the name of the ID name form so we get this form with JavaScript and now we can write form on submit equals function now let's write on the log to see what's happening yeah to get a value from form we access the data with name attribute so form full name full name and let's try it to see the data we need to show developer tools developers console and write some data I will write a storm sudden and form is still submitting we want to prevent this so our transcript can produce the form now this on submit even has a tribute function has a tribute event it can be write written like event or I prefer EFT shortcut sometimes can be just II okay I will just write a prevent proven default this will actually prevent the default functionality of the forum so let's try we click browser write something and yeah submit we can see the input text input now to get value from the text input we just drive value dot value thrive yep we have the value now we want to delete data after submitting form and yep simple thing is form reset let's try it tum submit okay let's write the result into this element so I will copy and paste this one and yeah storage int variable like result result and ID is result this is name of the ID of the element and instead of console.log we write result in our inner HTML equals to value and we say hi form full name value let's try it I can press the Enter yeah hi tomas apple slaw i submit and it works we don't know how to process data with javascript so form dot this name attribute name from the input and then just dot value and it gives us value and if we want to reset form just go for reset or this reset should work because this is actual form let's try this yep submit and it works it works with this and with form because this refers to this form pretty easy if we have some questions you can ask in comments below the video so I hope this helped you and you will know how to process forms with JavaScript okay bye.

If you believe that this page should be taken down, please follow our DMCA take down process here.