How can you programatically submit a type image

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jw56578@gmail.com

    #1

    How can you programatically submit a type image

    if i have an Input type Image
    how am i suppose to programatically submit it through JS.

    code:

    <INPUT type="text"
    onkeyup="javasc ript:if(event.k eyCode==13){btn Click.click();} ">

    <INPUT name="btnClick" type="Image" value="Button"
    onclick="javasc ript:alert('but ton was clicked');">

    clicking "btnClick" will raise the onclick event producing 'button was
    clicked', but onkeyup of the textbox will not call the click() method

    Im using Input type Image because that is what ASP.net produces for an
    image button.

  • kaeli

    #2
    Re: How can you programatically submit a type image

    In article <1117637348.182 853.324930@g49g 2000cwa.googleg roups.com>, jw56578
    @gmail.com enlightened us with...[color=blue]
    > if i have an Input type Image
    > how am i suppose to programatically submit it through JS.[/color]

    input type=image will automatically submit its form onclick.
    <input type="image" name="whatever" src="myButton.g if" alt="submit">

    No JS required.

    The onclick is automatically script. Ditch the "javascript :".
    onclick="somefu nction();"

    There is no such thing as submitting a button. If you want to submit the form
    without clicking the button (from another form element handler), use
    something like
    onClick="this.f orm.submit();"

    --
    --
    ~kaeli~
    When a clock is hungry, it goes back four seconds.



    Comment

    • jw56578@gmail.com

      #3
      Re: How can you programatically submit a type image

      That was no help, thanks. But I changed from onkeyup to onkeydown and
      it worked, so nevermind.

      Comment

      Working...