- Joined
- 2 Mar 2002
- Messages
- 1,572
I am hopelessly lost here.I am playing around with Ajax, but Javascript has stumped me.
Here is my code:
That gives me the right output in an input box when this is uncommented:
However, I don't want the output in the textbox, rather just printed out. What changes do I need to make to do this?
Here is my code:
Code:
<input type="text" name="x" id="x" value="2" size="3" /> *
<input type="text" name="y" id="y" value="3" size="3" /> =
<!-- This works if uncommented -->
<!-- <input type="text" name="z" id="z" value="" size="3" /> -->
<!-- Is this area correct? -->
<script type="text/javascript">
xajax_multiply(document.getElementById('x').value,document.getElementById('y').value);
</script>
<!-- Is it? -->
<input type="button" value="Calculate" onclick="xajax_multiply(document.getElementById('x').value,document.getElementById('y').value);return false;" />
That gives me the right output in an input box when this is uncommented:
Code:
<input type="text" name="z" id="z" value="" size="3" />
However, I don't want the output in the textbox, rather just printed out. What changes do I need to make to do this?