Results 1 to 6 of 6

Thread: Form Post Method without the Send button

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288

    Form Post Method without the Send button

    Is there any to send data through POST method if I do not use the Submit button. I need to use image in place of the Send button.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Code:
    <form name="frmTest" method="POST" action="path/to/whatever.cgi">
      <input type="text" name="txtTest" value="Hello"/>
      <input type="image" src="image1.gif"/>
    </form>
    the image input becomes the submit button.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    I would've just...

    Code:
    <div onclick="document.myForm.submit;"><img></div>
    'Course, the div may be optional. You might be able to just put the onclick event on the img tag. And I really would put the submit in a function and call the function, but you get the idea.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Just out of curiousity...

    why go through all of that if there is a simple, one-line way to do it built in?

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Originally posted by crptcblade
    Code:
    <form name="frmTest" method="POST" action="path/to/whatever.cgi">
      <input type="text" name="txtTest" value="Hello"/>
      <input type="image" src="image1.gif"/>
    </form>
    the image input becomes the submit button.

    Thanks
    crptcblade, are you into XML these days. Your syntax seems to be somewhat similar to what I know of XML.

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by amitabh

    Thanks
    crptcblade, are you into XML these days. Your syntax seems to be somewhat similar to what I know of XML.
    Yeah, I used XML for a while, so I just got used to closing single tags. That way, if I needed to make a style sheet out of existing HTML, I don't need to go back and put them in anyway.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width