set image as submit button - html

i am using following code to set an image as submit button
*<input type="submit" src="submit1.jpg" alt="submit Button"onMouseOver="this.src='submit1.jpg'">*
but i actually did not know at which place in whole code to put this line of code because i put it after but it is not working
at which place i put this code there appear "submit query" but i want it to submit query at buuto i also use
input type="image"
actually i want to ask from which place i start this code "from which line?"

Change type from input to image and add value as submit:
<input type="image" value="submit" src="submit1.jpg" alt="submit Button" onMouseOver="this.src='submit1.jpg'">

This is complete HTML document:
<form name="someform" action="http://www.google.com">
<input type="image" width="100" value="submit" src="image1.png" alt="submit Button" onMouseOut="this.src='image1.png'" onMouseOver="this.src='image2.png'">
</form>
Note that "onmouseout" event is used to bring the button to previous form when mouse is not over

Related

Href link on input button submit

How can i bind this link
<a href="edit?id=<c:out value='${person.id}' />">
to input button "submit" ?
try something like that. Hope this will fix your problem
href="\edit?id={{person.id}}"
Typically if you are using a submit button, then you will be inside a form. An example of this would be:
<form action="edit?id=<c:out value='${person.id}' />" method="post">
<!-- form fields here -->
<input type="submit" value="Submit" />
</form>
In this case, the submit button is "tied" to the form, and will post the form data to the link in the action value.
I found solution :
<input type="hidden" name="from" value="${param.from}">
Servlet.class
response.sendRedirect(request.getParameter("from"));

HTML Form Issue on IE

I have an HTML form which uses an image as a submit button. The problem I have is the value="Submit" is showing up as text over the submit image button on IE7 & IE8. can anyone tell how to prevent this? Thanks!
<div>
<input id="saveForm" name="saveForm" class="btTxt submit" type="submit" value="Submit" />
</div>
You can probably change
value="Submit"
to
value=" "
Or
It looks like you may need to change it to input type="image" instead of input type="submit"
Or
Possibly the submit button can be an Anchor or a Div with an onclick event handler.

Mimic HTML form for uploading a picture

How do I mimic HTML form "Browse" and "Submit" buttons as done in facebook?
My form is:
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
So far I can just do it in the traditional way. But what I really need is:
When the user clicks "Upload Picture" label or button or whatsoever, it mimics "Browse" button and on selecting a picture it mimics "Submit" button events. I don't want to show the odd looking browse and submit buttons...You got my point?
I've used PLUpload for something similar in the past. It is primarily for larger files, but it does the browsing and masking as you desire. I've even set up the JS to auto submit once the image is selected. It doesn't take much as long as you have the basic understanding of JS.
http://www.plupload.com/

POST when clicking an image

I have a "delete" icon with a relative position in the upper-right corner of a photo. When the icon is clicked, the photo should be deleted on the server.
According to HTTP conventions, this is a destructive action which should be done with POST. So a normal <img href> can not be used since it will cause a GET, which is more insecure.
What is the simplest way to make the icon perform a POST that does not exclude Internet Explorer 8? I am currently looking at:
<form method="post" action="script.php">
<img src="photo.jpg"/>
<input name="delete" type="image" src="/image/delete.png"/>
</form>
Or, is it acceptable to use a href in this situation?
(EDIT: Is it more acceptable when the script is only available to an authenticated administrator?)
you should use this code
<form method="post" action="script.php">
<button type="submit" style="background:photo.jpg"/>
<input name="delete" type="image" src="/image/delete.png"/>
</form>
so you can use your photo as background,because when you want submit a form you shold have a input or button whith type submit
<button type="submit" name="testsubmit" value="click"
style="border:none; background-color:transparent;">
<img src="button.png" alt="test image submit" />
</button>

how use button in internet explorer?

on my source i use
<a href='pag.php'><input type='button' value='Next'/></a>
in firefox and crome when i click on the button i'm redirected to pag.php
but in ie it don't work. how can i do?
The simple way is:
<input type='button' value='Next' onclick="location.href='pag.php'"/>
Form buttons are meant to be used for submitting a form to the page specified in the action attribute, not to be wrapped in <a> tags, which is bad syntax. If this is for a multi-part form, simply add the action attribute to the <form> tag like
<form method="POST" action="pag.php">
<!-- your form elements -->
<input type="submit" value="Next">
</form>
And that will submit the form to pag.php. Otherwise, just use a link, or, if you insist on having it look like a button, use an image link like:
<img src="image_that_looks_like_a_button.png">
Hope this helps.
Instead of what you are doing right now, go for:
<form action="pag.php" method="post" enctype="multipart/form-data">
<INPUT TYPE="submit" name="Submit" value="Next">
</form>
But if you want image instead in place of button, go for:
<INPUT TYPE="image" SRC="image location" ALT="Next">
Hope it solves your problem! :)