Jump to content

[SOLVED] How do I combine these?


Kane250

Recommended Posts

I was using a standard submit button that submitted information to a popup window, however I wanted to replace the button with a rollover image instead. The first code is the original code for the rollover, and the second is the code for the standard submit button. How do I combine these so that the rollover image submits the same way?

 

Thanks!

 

<a href="vcon.php"><img src="images/emailcheck.png" onmouseover="this.src='images/emailcheckro.png'" onmouseout="this.src='images/emailcheck.png'" /></a>

<input type='text' value="" name="email" /><br />
<input type='submit' onclick="wopen('mainsub.php', 'popup', 400, 375); return true;" value="Sign Me Up!"/><br />

Link to comment
https://forums.phpfreaks.com/topic/111634-solved-how-do-i-combine-these/
Share on other sites

I'll give you what I use. First, if your custom button is 25px in height and 100px in width you should make your graphic 50px height, 100px width and put what you want the rollover to be on the bottom part. You can always add the onclick="function();" in there too. I'm just tired and spent way to much time on here tonight :)

 

// html
<input type="submit" value="submit" class="button" onmouseover="this.className='button-over';" onmouseout="this.className='button';" />

// css
.button {
  border:0px;
  outline:0px;
  background:url('graphic.png') no-repeat 0px 0px;
  width: 100px;
  height: 25px;
}

.button-over {
  border:0px;
  outline:0px;
  background:url('graphic.png') no-repeat 0px -25px;
  width: 100px;
  height: 25px;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.