Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Old 05-13-2004, 09:38 PM forms
frosty's Avatar
Average Talker

Posts: 28
Location: southernville
Trades: 0
I have a newsletter form and was wondering how to change the sumbit button from the grey rectangle to an image I have. Any ideas? Thanks for any help!
__________________
Jesus Christ died for us all
frosty is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-14-2004, 12:17 AM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Instead of a input type="submit", you can use

Code:
<input type="image" src="yoursrc.gif" align="middle" alt="Submit Form" name="submit_btn" value="my value" />
(Code in italics sybolizes attributes which are options)

The name and value attributes may be useful if you are using the form to post to a script and require the submit button to actually pass a value (some scripts depend on a value from the submit button so it knows when to process the form or not). So you'd attach a name to the submit button, and give it a value if that was the case.

The image type acts exactly like the submit type. If you wanted a graphical "reset" button then you might have to use Javascript or simply reload the page.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 05-14-2004, 01:32 AM
frosty's Avatar
Average Talker

Posts: 28
Location: southernville
Trades: 0
hey hey, thanks!
__________________
Jesus Christ died for us all
frosty is offline
Reply With Quote
View Public Profile
 
Old 05-14-2004, 06:13 PM
Extreme Talker

Posts: 160
Trades: 0
Another way that would allow you to keep the functionality of Reset as well as Submit is by applying a StyleSheet instruction:

input {background-image : url("image.gif");}

If you only wanted the above to apply to a single button then you could use the 'class' attribute and adjust the instruction as follows:

input.nameOfClass {background-image : url("image.gif");}.

Your HTML would look something like this:

<input type="submit" class="nameOfClass" value="Send">
<input type="reset" class="nameOfClass" value="Clear">

Other instances of <input> that did not have this class would not have the formatting applied.

HTH
ElectricSheep is offline
Reply With Quote
View Public Profile
 
Old 05-14-2004, 07:33 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
You would need to also assign a height/width CSS property if you wanted to use that.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to forms
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66760 seconds with 12 queries