Why will form only submit when value=" " and not value=""

Discussion in 'Programming' started by MikeLugar, Feb 8, 2011.

  1. #1
    Why will my form only submit when the value has a space between the quotes?

    ex. This will submit:

    <input type="submit" name="Submit" value=" " />

    This will not: <input type="submit" name="Submit" value="" />

    I am not using a standard submit button, the submit button is a png image that is defined in the CSS.

    Is it ok to leave the value with a space between? It is working fine, but it just seems weird.
     
    MikeLugar, Feb 8, 2011 IP
  2. jkl6

    jkl6 Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have you tried this?
    <input type="submit" name="Submit"/>
     
    jkl6, Feb 9, 2011 IP
  3. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Because "value" is the text that would appear on the button like "Send Now, or Join Now, or Submit, or Create Now, etc). If you use the value element, it can not be null.
     
    longcall911, Feb 10, 2011 IP
  4. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #4
    I'd suggest that you remove the submit button .png image from your CSS file and use:
    
    <input type="image" src="button_image.png" width="xx" height="yy" />
    
    Code (markup):
    which will automatically submit the form when the user clicks on it.
     
    rainborick, Feb 10, 2011 IP