Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the image of a submit button

Status
Not open for further replies.

tomhughes

Vendor
Joined
Aug 8, 2001
Messages
233
Location
US
Does anyone know how to change the image of the submit button ? Or can I send a command from another button to activate the submit button ?
 
Try looking at Jules page at Charon or browse through the MM extension library, I can't recall where I saw it but there may be an extension available to do that (or was it a tutorial...?)
 
Hey Tom,

Yes it's pretty simple.
<input type=&quot;image&quot; border=&quot;0&quot; name=&quot;imageField&quot; src=&quot;images/submit_button.jpg&quot; width=&quot;84&quot; height=&quot;40&quot;>
 
schase - Do you know how to add script to an image button? If I create a sumbit button with the script shown below, I can get a value to increment, however I have tried to add this scrit to an image button, but it gives me syntax errors.

<input type=&quot;button&quot; value=&quot;click to increment&quot; onClick=&quot;n++; document.forms[0].i.value = n; parent.passText(n);&quot;>
 
are you trying to pass values to another page?

 
No - I am passing values to another frame.
 
ok, i'm going to give this a shot in the dark - and you may have tried this.


<input type=&quot;image&quot; border=&quot;0&quot; name=&quot;imageField&quot; src=&quot;images/submit_button.jpg&quot; width=&quot;84&quot; height=&quot;40&quot;>

Need to change the path and picture name as well as width and heigth to your image.

Then highlight the image, open behaviors window (not server behaviors) click the + select call Javascript and in the box put.

onClick=&quot;n++; document.forms[0].i.value = n; parent.passText(n);
 
It won't let me add javascript behaviors to the button properties. I have tried just adding the code into the button, in the code window, but it keeps giving me errrors.
 
that's strange

Try this

<input type=&quot;image&quot; border=&quot;0&quot; name=&quot;imageField&quot; src=&quot;images/submit_button.jpg&quot; width=&quot;84&quot; height=&quot;40&quot; onClick=&quot;MM_callJS('onClick=\&quot;n++; document.forms[0].i.value = n; parent.passText(n);')&quot;>

copy that where your current image is - replace &quot;images/submit_button.jpg&quot; width=&quot;84&quot; height=&quot;40&quot;
with your info.

 
I believe you are on the right track, but I can't get the syntax correct.
 
hmmm

post your script and the error message
 
It gives the error Unterminated String Constant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top