Jump to content

Recommended Posts

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.

  • Like 1
Link to post
Share on other sites

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.

  • Like 1
Link to post
Share on other sites

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 post
Share on other sites
  • 2 weeks later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...