Add to Google

How To Make Image Buttons Act As Submit Button

free web hosting
Open Discussion > General > Hosted Members Area

How To Make Image Buttons Act As Submit Button

SaNJ
Hi guys I m making a personal website ....
I asked in the forum how to create and use images as buttons...thanks for your help..
I can make them work as links....give some hovering effects etc...they work very well..untill I use them in forms and use them as SUBMIT or RESET button...when I do this nothing happens on clicking the image button...
the code I use is like

CODE
<code>
<input type='image' src='image.png' onmouseover='this.src='imag1.png'' onmouseout='this.src='image.png'' name ='cmd';
</code>

but there is problem in making them act as SUBMIT or RESET button.
I have tried very hard to make it work, but didn't succeed ....
I know html and CSS quite well but , don't know....Javascript...
Is there any way to achieve this..please....help

If u have code it will be very helpful...
thanks in advance.

Comment/Reply (w/o sign-up)

Nabb
If I recall correctly, there's a submit() function associated with forms. You could thus link (with an anchor tag) the image to
CODE
java script:document.nameoftheform.submit()


edit) ..except without the space between java and script, the tags keep putting it there sad.gif

Comment/Reply (w/o sign-up)

Erdemir
Try this one,
CODE
<form name="form1" action="target_file.php" method="GET or POST">

//Your form fields

//Here is the submit button
<a href="java script:document.form1.submit();" title="Submit the Form"><img src="image.png" onmouseover="this.src='image2.png';" onmouseout="this.src='image.png';" border="0"></a>
</form>

Comment/Reply (w/o sign-up)

hitmanblood
Well since there are a lot of people that don\t like using javascript predominantly the beginners.

Here is the same thing just without javascript understandable to everyone with basic html knowledge.

CODE
<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form">


Important thing is to notice that type of input has been changed. And good programing is to write alt so that if image doesn't load your users would be able to find and of course be able to use this submit button.

On the other hand royalties for this example go to codetoad.

Comment/Reply (w/o sign-up)

Erdemir
QUOTE(hitmanblood @ Aug 18 2008, 02:50 PM) *
CODE
<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form">

Sanj, want to make a hover effect submit button. I don't think that can make a hover effect.

Comment/Reply (w/o sign-up)

SaNJ
QUOTE(hitmanblood @ Aug 18 2008, 05:20 PM) *
Well since there are a lot of people that don\t like using javascript predominantly the beginners.

Here is the same thing just without javascript understandable to everyone with basic html knowledge.

CODE
<INPUT TYPE="image" SRC="images/submit.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form">


Important thing is to notice that type of input has been changed. And good programing is to write alt so that if image doesn't load your users would be able to find and of course be able to use this submit button.

On the other hand royalties for this example go to codetoad.


hey hitmanblood
I u notice that u have written the same code as I have written....
I told u ...that its not working ...It is acting as a button but not as a submit button.

 

 

 


Comment/Reply (w/o sign-up)

hitmanblood
After you told that it doesn't work I was intrigued why the hell this wouldn't work. And wrote small script to check it out whether it works or not. Now it works and you may have any image as submit button.

CODE
<html>

<head></head>

<body>


<form method="post" action="test.php" target="_self">

<?

if(empty($_POST['tester'])){
    
    echo 'doesn\'t work';
    echo 'lol '.$_POST['tester'];
    
}else{
    
    echo 'works<br>';
    echo $_POST['tester'];
    
}

?>





<input type="text" name="tester">
<!--
<input type="submit" value="submit">
-->

<INPUT TYPE="image" SRC="http://localhost/awesomemetalcamp.gif" HEIGHT="30" WIDTH="173" BORDER="0" ALT="Submit Form" value="submit">


</form></body></html>


The main difference from the previous one is that there is added value="submit" this is obligatory in order to work.

Best Regards hopefully I may have helped you,
Hitman

Comment/Reply (w/o sign-up)

PhyberOptycs
QUOTE(hitmanblood @ Aug 19 2008, 11:36 AM) *
After you told that it doesn't work I was intrigued why the hell this wouldn't work. And wrote small script to check it out whether it works or not. Now it works and you may have any image as submit button.

CODE
......

?>
<input type="text" name="tester">
<!--
<input type="submit" value="submit">
-->
.......


The main difference from the previous one is that there is added value="submit" this is obligatory in order to work.

Best Regards hopefully I may have helped you,
Hitman


Man, you beat me by a couple of minutes. I was also gonna say that the type='submit' was missing from all of these. Oh well, good job!

Comment/Reply (w/o sign-up)

hitmanblood
no man you've got it all wrong it is not type submit it is value="submit". Type submit is for the very basic submit button value submit means that the following picture will be used instead of submit button that is as submit button.

Best Regards

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. make an image work like a submit - 5.57 hr back. (1)
  2. change the src using php - 16.30 hr back. (1)
  3. make image submit button - 20.76 hr back. (1)
  4. how to make buttons out of an image - 23.69 hr back. (1)
  5. php submit image button withou java - 24.12 hr back. (1)
  6. php post without submit button - 42.74 hr back. (1)
  7. how to make image as submit button in jsp - 44.48 hr back. (1)
  8. php submit image button - 47.44 hr back. (1)
  9. how to make comment buttons - 48.36 hr back. (1)
  10. use image as submit button javascript - 49.68 hr back. (1)
  11. submit button gallery - 51.03 hr back. (1)
  12. how to do image button - 53.34 hr back. (1)
  13. how to make a submit form in java - 54.89 hr back. (1)
  14. make image act like jbutton in java - 57.24 hr back. (1)
Similar Topics

Keywords : make, image, buttons, act, submit, button

  1. Image Upload To Cutenews
    ....doesn't work (2)
  2. The Proper Method To Submit Tickets At Xistosupport
    Steps to submit tickets at Xistosupport (4)
    Hello, I have created here an email template to help get issues solved faster, this format is to
    help members AND support admins. Title :- My {Sub-domain} Needs The Password Reset
    Title :- My {Sub-domain) Is Giving Me An Error {Explain Error in 3-4 words if possible}
    Sub-domain name. Use the email address you have submitted in the HOSTING
    APPLICATION . Cpanel Username. Password (This is used to verify your
    account or check the error) If password needs to be reset then you n....
  3. How To Create Cool Image Buttons
    (7)
    Hi guys ... I m making a personal site thats for me a nd my friend group. What I need is a tool
    which can make cool image buttons to use in my HTML pages. Is there any site which offers such
    software or the buttons itself for free. I would like to make them on my own, I just need to know
    the tool.I can't go for an expensive tool like photoshop or corel. So please suggest me a free
    tool. Thanks.......
  4. Trap17 Dynamic Recent Post/topic Image
    (17)
    Some may remember a while back I created a dynamic image that would tell you your post count and
    last active for trap. It had a bit of a run but then died off. It just wasn't very useful.
    BUT NOW I am presenting the most epic trap17 image Ever. This one is SUPER customizable and already
    works for ALL MEMBERS ! It is designed to be put in your sig so other members can see the recent
    topics you have written. It is still in early early beta stage but soon it will have the date
    posted along with some other cool features. So I'm sure you are all excited to se....
  5. Problem With My Website Image
    wont show no mater wat (7)
    Hi, I am currently redesigning my website. There is something which is really baffling me about a
    particular image in the website. When viewed off line with either Internet Explorer 7, Opera v9.0.2,
    Mozilla Firefox 2.0.0.4 or Netscape Navigator 9.1b, everything works quite fine and there are no
    missing images. Come to think of it that after I upload the pages to my website, I was astounded to
    find out that some of the images simply refused to display despite uploading every single file and
    folder in my offline website. I have gone back and cross-checked to make sure....
  6. Report Button Doesn't Work
    Advice admin to act imediatly. (3)
    When i try to submit a report of a topic/post, i can't do it because it shows up a page that has
    nothing to do with it. I advice a moderator/admin to act now, it is not the first time i try to
    report a topic/post, and this has beeing going for days now, i don't know if you know that, but
    i though it was better to say this in a topic since i can't report anything due to the problem i
    have described. ....
  7. Banner/button
    (4)
    hello, I am wondering where to get a banner or button of trap17 for my site. I want the button or
    banner because i am making a tutorial on how to build a web site and want to mention trap17. If you
    wouldn't also mind could i get banners/buttons for other Xisto hosting sites? Thank you in
    advance.....
  8. How To Submit Website To Search Engines
    (2)
    can any one tell me how to submit the website to the search engines using the built-in script
    function in the trap17 hosting.I submitted 2 days ago , to all search engines using that script but
    today google is saying that no any page of my domain is indexed there.how i can know if my website
    is submitted to search engine or not ? my site url is http://pakdir.com thanks....
  9. Fantastico- Image Gallery Software
    Which one do you recommend? (4)
    Hi there! I've been looking into using one of the image gallery programs provided in cpanel -
    both Coppermine and Gallery look really good. Although many of the opinions out there are varied,
    I'd like to know which one would you recommend out of the two? Coppermine is widely available
    and has lot of skins, but what about Gallery (especially the new version that just came out)?....
  10. Any Good Image Galleries?
    Looking for a good image gallery! (9)
    Okay, are there any good image galleries, Outside of teh fantastico ones, (4images) (Gallery) and
    teh other one, because all of those are like a website of its own, and u need to get like a good
    theme for it, is there any good liek image gallery i can jstu isnert to an HTML website page?....
  11. Does Trap17 Have A Button?
    For Linking To Trap17.com From My Site (7)
    Does Trap17 have a linking button? I want to put it on my site, at the bottom of each page, like
    this: Hosted By * Trap17 Link Button Here* If they don't already have a button, can we make
    one? I'm willing to make a simple 88x31 button and then post it so everyone can use it.
    /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> ....
  12. Up Centering Tables And Image Mouse Over Effect
    (3)
    Hi all, I got a few html questions... 1. How can I make the content of a table start from the top?
    (Normally it centers vertical...) 2. How can I make an image change into a different 1 if you go
    over it with the mouse? (This is a frontpage effect but suckely I dont have any working version of
    frontpage)....
  13. Forum Signature- Image Display Problem
    Signature Image does not display when viewing forum posts (8)
    Hi all, Just a minor problem, The image I chose to use in my forum signature doesn't display
    when I go back to view my posts. It just shows as a blank white box w/ red X in it. I'm 95%
    certain I used the correct syntax to code it into the signature. Uploaded a image to the root
    directory of my hosted website at trap17. Does where the image is hosted make a difference?? Any
    tips??/ suggestions?? RGPHNX....
  14. What To Enter In "comments" For Search Engine...
    Submit. In the CPanel (3)
    What should we enter in "comments" for the cpanel search engine submit?....
  15. Make Image Change When Hovered W/o Flash?
    How? (4)
    Is there a way to make images on a page change without having to use flash/ Java?....
  16. Trap17 Button?
    supporters (3)
    ok i have a phpnuke platinum board and would like to add trap17 to the supporters list. i have put
    up the link and that but cannot find a trap17 button, so im currently using is there a good trap17
    button that members have used/made? thx for any help. www.dlab.trap17.com....
  17. Linking Back To Trap17
    I want to put a small image link... (6)
    Is there somewhere where I can get a small image, like 88x31? I want to put a nice button on my
    site to link to Trap17, to show my appreciation.....
  18. Free Image Hosting Service
    need help (4)
    Can someone recommend a website that offers image hosting service to serve up signatures, etc...
    images for forums and will also send the link for my uploaded image to my email address?
    /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" />....
  19. Php-nuke Reset Button :p
    People must think im so stupid...... (5)
    Hey, there is an error with my phpBB forum and i cannot get access to the admin control panel. I
    decided to "reset" the whole thing but i dont know how. I DO NOT want to upload everything again.
    Please, i just want to delete all of the information. Thanks 4 all of ur help everyone
    /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />....

    1. Looking for make, image, buttons, act, submit, button

Searching Video's for make, image, buttons, act, submit, button




advertisement



How To Make Image Buttons Act As Submit Button