SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Sep 2010
    0 Post(s)
    0 Thread(s)

    Exclamation PHP JavaScript and HTML, seemingly not calling the function.

    Hey everyone,
    This is my firist post, I have been searching for the answer for quite a while and trying many different solutions. I have some java experience but I think I have done something wrong in the code. I'm trying to get the html boxes to update number that is being drawn to the scree when it has been changed. there are 3 boxes that call a function that requires 3 arguments (this is the part I think I'm messing up. Here is the code:
    				<label for="buy">Buy Price: <input type="text" name="buy" 
    						id="buy" onchange="solve(,," value="<?php htmlout($buy); ?>"/></label>
    				<label for="freight">Freight: <input type="text" name="freight"
    						id="freight" onchange="solve(,," value="<?php htmlout($freight); ?>"/></label>
    				<label for="markup">Markup: <input type="text" name="markup"
    						id="markup" onchange="solve(,," value="20"/></label>%
            Sell Price: 
    			<script type="text/javascript">
    			function solve(x,y,z)
    	  	var buy=document.getElementById(x).value;
    			var freight=document.getElementById(y).value;
    			var markup=document.getElementById(z).value;
    			var newmarkup;
    			var sell;
    			var markupamount;
    			newmarkup= "0."+markup;
    			var i = Integer.parseInt(newmarkup.trim());
    I believe it should work, but as I said I have only done a little with java and I think I'm messing up somewhere with the arguments.

    Let me know if you need any more information, thanks heaps for any help you guys can offer!
    Last edited by paul_wilkins; Sep 1, 2010 at 18:10. Reason: The scripting language is not Java


Posting Permissions

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