Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > newbie question

Reply
Thread Tools

newbie question

 
 
siliconmike
Guest
Posts: n/a
 
      08-15-2005
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

 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      08-15-2005
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
 
Reply With Quote
 
 
 
 
Fly Cooter
Guest
Posts: n/a
 
      08-15-2005
In article <(E-Mail Removed). com>,
http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-15-2005
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

 
Reply With Quote
 
Alan J. Flavell
Guest
Posts: n/a
 
      08-15-2005
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]

 
Reply With Quote
 
Peter Flynn
Guest
Posts: n/a
 
      08-15-2005
Toby Inkster wrote:

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


may ::= will



///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      08-16-2005
Toby Inkster wrote:
> 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:


A less inaccessible (but still icky for other reasons) solution is to
disguise a button as a link, as in <http://ecritters.biz/disguises/>.
 
Reply With Quote
 
Nicknamezj
Guest
Posts: n/a
 
      08-18-2005
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="(E-Mail Removed)?subject=your-subject" method="post"
enctype="text/plain">

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

~Nick

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VONAGE Newbie w/newbie question New_kid@nowhere.new VOIP 0 08-11-2007 01:40 PM
another newbie question from another newbie.... Lee UK VOIP 4 05-17-2005 04:10 PM
newbie: cisco vlan newbie question No Spam Cisco 3 06-07-2004 10:02 AM
dumb newbie question (or newbie dumb question) Jerry C. Perl Misc 8 11-23-2003 04:11 AM
Newbie! I'm a newbie! What's wrong with this program? Id0x Python 4 07-20-2003 11:40 PM



Advertisments