Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2004
    Location
    Minnesota, USA
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing out ...

    I am hopelessly lost here.I am playing around with Ajax, but Javascript has stumped me.

    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?
    ribbed.us
    ---
    To err is human, to moo bovine.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    What is the Ajax code. That appears to be what is setting the third textbox. Since nothing you wrote here says where to output it.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •