Computing.Net > Forums > Web Development > Simple question on html input form

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Simple question on html input form

Reply to Message Icon

Name: Evans007
Date: January 21, 2009 at 13:21:19 Pacific
OS: Windows Vista
CPU/Ram: e8400/4gb
Product: Me / NONE
Subcategory: HTML
Comment:

Hey guys, to cut to the chase, I have an input form for a basic calculator that our tutor gave us. I'm editing this so that instead of "input type="button"" it should be "input type="image"..> I can get the image I want to display perfectly. But internet explorer is ignoring the onClick event that puts the numerical value of the image on the form of the calculator, and just refreshes the page instead! I cant get round this, cheers for any help!



Sponsored Link
Ads by Google

Response Number 1
Name: shutat
Date: January 22, 2009 at 18:38:01 Pacific
Reply:

I think there's a bug in the way IE handles forms - buttons with images; try reading over this blog and see if maybe it will help. Do you need a button? If you're using javascript, how about TD along with a background image?

<script language="javascript">

var sum = 0;

function change(id) {

   sum += parseInt(id);
   document.getElementById("txt").innerHTML = sum;
}
</script>
<table>
<tr>
<td background='somefile.gif' id='7' onclick='change(this.id);'>7</td>
<td id='8' onclick='change(this.id);'>8</td>
<td id='9' onclick='change(this.id);'>9</td>
</tr>
<td id='4' onclick='change(this.id);'>4</td>
<td id='5' onclick='change(this.id);'>5</td>
<td id='6' onclick='change(this.id);'>6</td>
</tr>
<td id='1' onclick='change(this.id);'>1</td>
<td id='2' onclick='change(this.id);'>2</td>
<td id='3' onclick='change(this.id);'>3</td>
</tr>
<td id='0' onclick='change(this.id);'>0</td>
<td id='a'> </td><td id='b'> </td>
</tr>
</table>
<p id='txt'></p>

What code do you have?


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Simple question on html input form

question on HTML tables www.computing.net/answers/webdevel/question-on-html-tables/1652.html

Secret question on hotmail www.computing.net/answers/webdevel/secret-question-on-hotmail/2017.html

Image placing question www.computing.net/answers/webdevel/image-placing-question/1900.html