0

My form:

<form method="POST" action="AController">
    <div class="userInput">
        <table class="userInput">
            <tr>
                <td><input type="text" id="username" name="login"></td>
            </tr>

            <tr>
                <td><input type="submit" id="submitRegInput" name="reg"
                    value="Submit"></td>
            </tr>
        </table>
    </div>
</form>

I'm trying to style

<input type="submit" id="submitRegInput" name="reg" value="Submit">

like this:

#submitRegInput {
background: no-repeat url(../images/okBtn.png) 0 0;
}

but it doesn't work. My AController :

if (req.getParameter("reg") != null) {
//doSmthingHere
}

How to change input to button:

<button type="submit" id="submitRegInput">
    <img src="images/okBtn.png" height="40" width="40" />
</button>

so it does same job as input submit button did? Or what is the way to style input type=submit button with image?

Ruslan Lomov
  • 485
  • 1
  • 7
  • 20

1 Answers1

0

jsp form button instead of input:

<button type="submit" id="submitRegInput" name="reg">
           <img src="images/okBtn.png"/>
</button> 

and css:

#submitRegInput {
background: no-repeat url(../images/okBtn.png) 0 0;
border: none;
}
Ruslan Lomov
  • 485
  • 1
  • 7
  • 20