I am trying to add a gif onto a HTML page which will act as a reset button for a form. i know how to make a standard reset button but don't know how to add this funtionality to a GIF, can anyone help?
Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
Angela, I prepared a small html file which has a form, in which there are some input fields and instead of RESET button an image is taken from the current directory. When you click on that image the fields will be reset. I used JavaScript to do that. Also I purposly inclided 'spaces' inside all html tags in order to prevent this forum interpret them. So please edit them back when u use them. regds maha anna <pre> < HTML > < HEAD > < TITLE >Duke< /TITLE > < /HEAD > < BODY > < script > < !--<br /> function clearForm(){<br /> document.LayoutForm.reset();<br /> }<br /> //-- > < /script > < FORM NAME="LayoutForm" ACTION="" METHOD=POST > < TABLE > < TR > < TD >< P >FirstName< /TD > < TD >< P >< INPUT TYPE=TEXT NAME="FormsEditField1" VALUE="" SIZE=9 MAXLENGTH=10 >�< /TD > < /TR > < TR > < TD >< P >Age< /TD > < TD >< P >< INPUT TYPE=TEXT NAME="FormsEditField2" VALUE="" SIZE=9 MAXLENGTH=10 >�< /TD > < /TR > < TR ALIGN=CENTER > < !-- < TD COLSPAN=2 >< P >< IMG ID="Picture1" HEIGHT=68 WIDTH=55 SRC="duke.gif" lang="javascript" onclick="clearForm()" >�< /TD > --> < TD COLSPAN=2 >< P >< IMG HEIGHT=68 WIDTH=55 SRC="duke.gif" lang="javascript" onclick="clearForm()" > < /TD >
I get a notice in the staus bar saying error on page when I click on the image. It seems to be having a problem with the line with the < IMG > tag. I've removed the spaces and can't see anything else obvious.
Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
Angela, what browser you are using? If it's Netscape, just type "javascript:" next to "Location:" sign(where you are entering URLs)and press "enter". You will see so-called Javascript console window, and it will show the exact source of your error. Try it.
Angela, I have edited the above file shown in my previous post. Now the 'RED' colour line has NO ID field. Try in this way. Otherwise instead of lang="javascript" try language = "javascript". The minimum fields needed for an image to show are 'src' and 'width' and 'height'. Try and change these fields as necessary. You will definitely succeed. regds maha anna
Brilliant, it works thanks!!! Unfortunatly all the time it took to try to sort it out meant that the reset button was removed from the page by my boss, who now regrets it cos it would have made things alot better , but deadlines to meet and all that! Never mind at least I'll know for next time, thank you
Pounding at a thick stone wall won't move it, sometimes, you need to step back to see the way around.
Hi, This is all fine for me. But I have an additional problem. I have a submit button and a reset button. I can implement the reset button as specified above. But the mouse behaves differently when it is over the submit button and when it is over the reset button. Any ideas on how to solve this will be helpful Rahul
HI, I am not able to use the reset button as specified. I have tried the code that is written above but it gives me the error that object does not support this property or method. I am using IE 6.0. While I try to open the page in mozilla firefox 1.5.0.3 it is not giving me any error while I click the image but nothing happens i.e. it does not reset anything.
Thanks and Regards, Prashant Deshani
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.