Click here to get back home

newbie question

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
newbie question siliconmike 08-14-2005
Posted by siliconmike on August 14, 2005, 5:51 pm
Please log in for more thread options


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


Posted by Fly Cooter on August 14, 2005, 7:50 pm
Please log in for more thread options


siliconmike@yahoo.com says...
>
>
>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.

--
Fly Cooter
http://fly-cooter.tripod.com


Posted by Randy Webb on August 14, 2005, 10:28 pm
Please log in for more thread options


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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly

Posted by Alan J. Flavell on August 15, 2005, 9:28 am
Please log in for more thread options


On Sun, 14 Aug 2005, Randy Webb wrote:

> 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.

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.

> > 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.

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

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

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]


Posted by Toby Inkster on August 15, 2005, 7:30 am
Please log in for more thread options


siliconmike wrote:

> 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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact


Similar ThreadsPosted
newbie frame question December 19, 2004, 9:58 pm
Newbie question: favicon.ico June 28, 2005, 12:22 pm
A newbie question about NVU (templates) May 25, 2007, 12:29 pm
Newbie Text Wrap Question October 6, 2005, 3:29 am
Stupid Newbie question Mozilla vs. IE May 20, 2005, 9:55 am
document.getElementById newbie question May 9, 2008, 1:50 pm
Newbie question: css layout with 3 columns (left align, use all remaining space, right align) March 29, 2006, 10:36 pm
newbie July 15, 2004, 10:22 am
Newbie help June 27, 2005, 10:01 pm
Help for Newbie - Want to Send JPG as Example - Ask How To November 1, 2004, 11:02 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap