i have problem about submit form
here it is

echo "<input type=submit name=submitbutton[selectall] value=\"" . $Select["Select Al
l"] . "\">\n";

i want to change it as image button but it never working when i replace word submit as image +src

someone help me ,please.

    • [deleted]

    isn't it :<input type=image src=bla.jpg name=submitbutton value=bla>

      There's nothing wrong with this, the only thing I can see is that maybe its the fact that you have not put the bits in speech marks.

      <input type='image' src='image.gif' border='0'> etc

        4 months later

        probaly the problem was that the script uses submit button name to decide what to do.
        something like that:

        <form action=test.php method=post>
        <input type="text" name="val" value="<? echo $val;?>"><br>
        <input type="image" src=image/some.gif name="first" value="lala" border=0>
        <input type="image" src=image/some.gif name="second" value="lulu" border=0>
        </form>

        <?

        if ($first_x){
        echo "first";
        } else if ($second_x){
        echo "second";
        }

        ?>

        note, use VARNAME_x - php split var name to x and y

          a year later

          I'm having problems with submit images too. My form works fine when I've a <input type="submit"... in. I then use a "if ($submit) { ... }" type arrangement. As soon as I try and replace that with <input type="image" src="img.gif" name="submit"....
          it stops working.

            OK, figured out my problem anyway. Php takes the TWO values $button_x and $button_y when a user clicks on an image button called "button" to pass the x and y of where the user clicked.
            Testing for "if ($button){..." is no good. Simply replace that with "if ($button_x > "0"){..." That solved my problem. hope it helps 😉

              3 months later

              While I use get method when post does NOT work,I get this:

              map.x=151&map.y=25

              NOT:

              map_x=151&map_y=25

              echo $map_x;
              echo $map_y;

              nothing output.

              anyone can help me?

              win98/ie6

              chase wrote:

              OK, figured out my problem anyway. Php takes the TWO values $button_x and $button_y when a user clicks on an image button called "button" to pass the x and y of where the user clicked.
              Testing for "if ($button){..." is no good. Simply replace that with "if ($button_x > "0"){..." That solved my problem. hope it helps 😉

                Write a Reply...