Form submission


Form tag attributes :  
Create a sample form with first and last name and submit to another html page using from use form methods
1. Form action
2. ID

Ex :







Submit the same form using HTML form methods :
1. Get
2. Post

1. Get Method :
<form id="my_form" action="key_events.html" method="GET">





2. Post Method :

<form id="my_form" action="key_events.html" metod="POST">






3. OnSubmit: what is the use ofonsubmit for form :






Create a sample form and don’t submit is using default form action.. Submit it the from in javascript using submit button :







Don’t use submit button in a form and create a normal button and submit the form on button click :



1. Required: use this for html elements and validate in javascript

2. Number: Validate number

3. Create a number text box and if textbox value is number then submit the form otherwise give an alert that “number text box will only accept the numbers” and  remove the text entered in that text box and focus on number text box.

Ex :



4. Submit your from to “turbomodus.com” web page




5. Design a simple form and Submit your form to google and search in the google with the value entered in the textbox



logoblog
Previous
« Prev Post