Form Method?

D

Dennis Marks

I only use forms as input and output to javascripts. Many times I use
innerhtml to write to a <div> for output. I don't know of an
alternative for input.

I sometimes have problems if I use method="post" and just leave it off.
The browser tried to reload the page after the script ran. Sometimes I
am able to even leave off <form> and </form>. Could someone explain
when form and method are actually needed?

I responded in comp.lang.javascript to "Adding to fields with
onchange". I had to leave "method=" out to get it to work without
trying to reload the page.
 
M

Martin Johansen

Dennis said:
I only use forms as input and output to javascripts. Many times I use
innerhtml to write to a <div> for output. I don't know of an
alternative for input.

Forms fields serve as input for the program after the action="program"
in the said:
I sometimes have problems if I use method="post" and just leave it off.
The browser tried to reload the page after the script ran. Sometimes I
am able to even leave off <form> and </form>. Could someone explain
when form and method are actually needed?

The input is sent as either method="post" or method="get"

Get sends the input via the url like this

http://www.google.com/imghp?hl=en&tab=wi&q=

And post send the input as a data stream to the program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top