anr241193 Posted August 28, 2016 Share Posted August 28, 2016 What is the difference between: <form> tag and <div> tag ? Link to comment Share on other sites More sharing options...
davej Posted August 28, 2016 Share Posted August 28, 2016 A form is something that you use to enclose and identify a set of inputs that are going to be submitted to the server. A div is merely an enclosing block element that can be used for structure and/or to identify a certain part of a page. 1 Link to comment Share on other sites More sharing options...
anr241193 Posted August 28, 2016 Author Share Posted August 28, 2016 Is it possible to replace form tag with div and use javascript to submit form? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 28, 2016 Share Posted August 28, 2016 You need a form element to initiate a submit, the usual way is to use a form identifier such as id ref and apply .submit() to it, in JavaScript. The form tag identifies type of form such as encryption type, request type GET or POST, action url to go to once submitted, are you planning to recreate this for a div? why, when form tag already exist. I suppose you could submit it as ajax request, but you would have to gather all the information, to send to php page to process and redirect to landing page? seem long winded way of doing it, when the form tag is made for this type of process. 1 Link to comment Share on other sites More sharing options...
davej Posted August 28, 2016 Share Posted August 28, 2016 As Dsonesuk says, in the traditional webpage operation you would submit a form to the server and then load another page with the results obtained from the server. A newer approach is to not use a form, but instead to use Javascript to communicate with the server in a background operation generally known as AJAX. Then there are the people who say that both methods should be used, with the form being the fallback method if Javascript has been turned off by the user. Link to comment Share on other sites More sharing options...
anr241193 Posted August 29, 2016 Author Share Posted August 29, 2016 (edited) Thanks! Edited August 29, 2016 by anr241193 Link to comment Share on other sites More sharing options...
anr241193 Posted September 9, 2016 Author Share Posted September 9, 2016 What is virtual dom? Link to comment Share on other sites More sharing options...
johnniewalk Posted October 4, 2016 Share Posted October 4, 2016 Virtual domain means in a single server hosting multiple domain with different names. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now