This topic is locked

Replacing search button with own picture.

6/30/2008 4:51:51 AM
PHPRunner General questions
M
mmponline author

How do one replace the search button to show a chosen picture?

<INPUT class=button onclick="java script: RunSearch();" type=button value=Search>


Thanks for your help!

J
Jane 6/30/2008

Stephan,
just add style parameter to this button:

<INPUT class=button onclick="java script: RunSearch();" type=button value=Search style="background: ...">

M
mmponline author 6/30/2008

I've changed my code to:

<INPUT class=button onclick="java script: RunSearch();" type=button value=Search style="background: src="images/vacancy.jpg">


but it is then automatically changed to:

<INPUT class=button style="BACKGROUND: none transparent scroll repeat 0% 0%" onclick="java script: RunSearch();" type=button value=Search images vacancy.jpg?>



when clicking visual editor and back to code view.
I need to replace the "search" and "show all" buttons individually so that it displays different buttons, each with a picture that contains the text on it already.

M
mmponline author 7/8/2008

Just can't get this working.
I need to put a picture (go.jpg) in the place of the find button.
Please assist with a code.

J
Jane 7/9/2008

Stephan,
here is a sample:

<INPUT style="background: url("img/image.gif") center repeat top;" onclick="java script: RunSearch();" type=button value=Search>

G
garethpDevClub member 7/9/2008

Jane
I can not get this to work either and get the same problem as Stephan.
I have tried to change the code in visual editor from

<INPUT class=buttonb onclick="java script: RunSearch();" type=button value=Search>


to

<INPUT style="background: url("img/edit.gif") center repeat top;" onclick="java script: RunSearch();" type=button value=Search>


but this does not work and the code is still automatically changed to

<INPUT style="BACKGROUND: none transparent scroll repeat 0% 0%" onclick="java script: RunSearch();" type=button value=Search top;? repeat center edit.gif?) img>


Any ideas?

J
Jane 7/9/2008

Sorry for my fault.

Here is the correct code:

<INPUT style="background: url(img/image.gif) center repeat top;" onclick="java script: RunSearch();" type=button value=Search>

M
mmponline author 7/11/2008

Code does not work
Throws away the repeat part, picture does not show and the button does not search when clicked.

H
horsey_kim 7/12/2008

Try this it worked for me. Just remember to size your image to the size you want for the button.
<input onclick="java script: RunSearch();" type=image src="image.jpg" border="0" value=search>
Hope that helps <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30984&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
NOTE I just uploaded my image I wanted to use into the main directory where my php files are stored - I did not put it in any subdirectory.

S
swanside 7/13/2008

In Visual editor, high light over the link you want to replace with a picture, then click on the insert image on the top bar and select the image you want to use.

H
horsey_kim 7/13/2008

Swanside,
Cool thanks, much easier way then editing the code.
Kim <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30992&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

M
mmponline author 7/13/2008

Does not work with buttons. Still haven't got an easy sulotion for it.

H
horsey_kim 7/13/2008

Does not work with buttons. Still haven't got an easy sulotion for it.


Did you try the one I suggested? Because I tested it and it worked great.
<input onclick="java script: RunSearch();" type=image src="image.jpg" border="0" value=search>
See notes in my above posting.

H
horsey_kim 7/13/2008

I just noticed in this forum when I type in code and have javascript in the code and it automatically puts a space in between java and script (java script) - maybe that is the problem. Make sure there is no space in javascript.

M
mmponline author 7/14/2008

Works fine now
Thanks for everyones input!