newbie question

S

siliconmike

I have a form inside which there are many links (not buttons).

How can I post form data when user clicks on any of these links ? Do I
need Javascript, or is this possible by regular html ?

I believe that form data can be posted using HTML, only when user
clicks on a button, right ?

Mike
 
R

Randy Webb

siliconmike said the following on 8/14/2005 8:51 PM:
I have a form inside which there are many links (not buttons).

Use buttons, make them of type submit, and submit the form.
How can I post form data when user clicks on any of these links ?
Do I need Javascript, or is this possible by regular html ?

Client-Side Scripting of some sort.
I believe that form data can be posted using HTML, only when user
clicks on a button, right ?

Or the Enter Key when a form field has focus.
 
F

Fly Cooter

I have a form inside which there are many links (not buttons).

How can I post form data when user clicks on any of these links ? Do I
need Javascript, or is this possible by regular html ?

I believe that form data can be posted using HTML, only when user
clicks on a button, right ?

Mike

Search Yahoo or Excite for "free form mailer" (without the quote marks)
and you will find free services that do it for you, and they provide you
with HTML code to paste.
 
T

Toby Inkster

siliconmike said:
How can I post form data when user clicks on any of these links ? Do I
need Javascript, or is this possible by regular html ?

It *can* be done with Javascript:

<form id="myform" method="GET" action="handler.cgi">
....
<a href="flibble.html" onclick="document.getElementById('myform').submit">
....
</form>

But that is probably a *very* bad idea. People expect to submit a form by
clicking a button -- not by following a link. If you don't use a button to
submit the form, then you may confuse your users.
 
A

Alan J. Flavell

siliconmike said the following on 8/14/2005 8:51 PM:


Use buttons, make them of type submit, and submit the form.

Don't use <button>s, they aren't implemented to specification by MSIE.
Use <input type=submit ....> controls, whose implementation is
generally reliable. Identify which one was used by appropriate use of
their name= and value= attributes.
Client-Side Scripting of some sort.

Don't rely unnecessarily on client-side scripting. Use it, if at all,
only for an *optional* additional convenience.

That's intentional: form submission by POST (as opposed to GET) is
intended for actions which undertake some significant action, such as
ordering a pizza, casting a vote, etc. As such, there should be no
doubt in the user's mind as to whether they are undertaking this
action. The design should, as far as possible, defend the user
against inadvertent submission of such a request.
Or the Enter Key when a form field has focus.

Some browsers do that, yes, although it's debatable whether it's
correct behaviour by the browser, since it *can* result in a user
inadvertently performing a POST request. Arguably, it should only
happen when the focus has been placed on the "submit" control. But
that's more a browser design issue, less a web page design issue.

best regards

[crossposted groups - I've proposed narrowed f'ups]
 
P

Peter Flynn

Toby said:
It *can* be done with Javascript:

<form id="myform" method="GET" action="handler.cgi">
...
<a href="flibble.html" onclick="document.getElementById('myform').submit">
...
</form>

But that is probably a *very* bad idea. People expect to submit a form by
clicking a button -- not by following a link. If you don't use a button to
submit the form, then you may confuse your users.

may ::= will

:)

///Peter
 
N

Nicknamezj

For you to POST the data your self you would need a severside script,
(like: php or perl).
Javascript can be used to use the data, but it can not post it because
it's a clientside scripting. For the HTML, by its self can email you
the data using the action="mailto:"
looks like:

<form action="mailto:[email protected]?subject=your-subject" method="post"
enctype="text/plain">

And yes, you are right about the user needing to click the submit
button.

~Nick
 

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,536
Members
45,017
Latest member
GreenAcreCBDGummiesReview

Latest Threads

Top