Web Analytics Made Easy -
StatCounter Input Type "Image" NOT passing value in MSIE - CodingForum

Announcement

Collapse
No announcement yet.

Input Type "Image" NOT passing value in MSIE

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Input Type "Image" NOT passing value in MSIE

    Hey folks... I'm trying to find a way to get this code to work in MSIE... (It works fine in Firefox)

    I'm trying to get the input type of "Image" to pass a value through the form but having a lot of difficulty.

    http://projectvibe.net/form/image.htm
    Code:
    <form name="songRatingForm" method="post" action="http://projectvibe.net/form/echo.php">			
      <input name="first" type="hidden" id="first" value="michael">		
      <input name="rating" type="image" value="1" src="http://projectvibe.net/images/1.gif" border="0">
      <input name="rating" type="image" value="2" src="http://projectvibe.net/images/2.gif" border="0">
    </form>
    and here is the receiving code...
    http://projectvibe.net/form/echo.php
    PHP Code:
    <?php
    echo "the rating is == ".$_POST[rating];
    echo 
    "<br>the first name is == ".$_POST[first];

    ?>
    Your help is MUCH appreciated!

    Elliott
    Elliott
    http://projectvibe.net

  • #2
    Images defined as form fields pass two values in the form data which are the X and Y co ordinates within the image that the mouse click occurred at in order to submit the form. Some browsers also pass the value associated with the image but this is non-standard and standards compliant browsers are not required to pass anything except X and Y. This is one instance where Firefox passes an additional field that is not required by the standards (probably because whoever wrote that part of the browser misunderstood the purpose of images in forms). Nothing is supposed to be passed with the form for an image if the form was not submitted by using a mouse click within that image.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      So you might want to try <input type="button">.

      Comment


      • #4
        Thanks guys... I tried a little something different. Might not be efficient but it gets the job done.

        Instead of having different values in the same form, I just used multiple forms.


        Thanks again for your input!
        Elliott
        http://projectvibe.net

        Comment

        Working...
        X