help please!!!

liunx

Guest
Hi, <br />
<br />
I am a very new in web programming. I have a problem with this page. When I put a question like '10 cm in inches', or ' 3 pounds in kilograms', it gives me multiple answers! <br />
How do I align the three tables? I tried thousands of different ways, but I still don't know how to do it. Is it possible to put the answer on the same page as the question form is? How do I do that? <br />
<br />
Here is the source as attachment. Can you have a look at the page? <br />
<br />
Give me an answer please!<br />
<br />
Thank you<!--content-->To align tables put align="center".:)<!--content-->Several small mistakes here:<br />
...var inch = -5<br />
var cm = -5<br />
var mile = -5<br />
...<br />
You must have a semicolon at the end of each statement in JavaScript.<br />
<!-------------------------------------------<br />
You can't have a --sequence within a comment (<!-- -->)<br />
____<br />
Ok, to display the answer on the same page, you can put a div element like this:<br />
<div id="answer"></div><br />
and then in JavaScript you can say<br />
<br />
window.document.all['answer'].innerHTML = "your HTML tags".<br />
this should actually work with any html tag that can have other tags inside it.<br />
____<br />
You could let the users select your units from a list of items, using <select>, but that is too easy and the way you let them ask a question is pretty professional, artificial intelligence, cool.<br />
Your script is pretty long and some sections seem to repeat. You could optimise it, etc.<br />
____<br />
Aligning tables:<br />
I would use one big table with the other tables within them.<br />
____<br />
<br />
It is general knowledge that I can't explain things. So if I failed to make something clear, post and I'll try harder.<!--content-->I don't understand when u say that i did several mistakes in the code. Can you explain pleae? Or tell me what shall I put instead?<br />
<br />
<br />
<br />
<br />
code:--------------------------------------------------------------------------------...var inch = -5<br />
var cm = -5<br />
var mile = -5<br />
...--------------------------------------------------------------------------------<!--content-->Originally posted by King Pellinore <br />
You must have a semicolon at the end of each statement in JavaScript.<br />
Not always. If you have more than one statement on a line, a semi-colon is required to separate the statements. However, an end-of-line character will end a javascript statement just as syntactically correct as ending it with a semi-colon.<br />
<br />
It helps readability and debugging if you always use them.<!--content-->
 
Back
Top