1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I Need Help Regarding Creating a JavaScript

Discussion in 'JavaScript' started by KIKAN, Apr 10, 2007.

  1. #1
    Hi Friends i am new to Java i want to create A Java Script to be implemented on http://hydbullion.org
    its a calculating script

    like this

    This Value Editable 675.20
    + 1.30
    This Value Editable * 43.10
    This Vale Fixed * 31.99
    This Vale Fixed + 10300
    This Vale Fixed * 101
    This Vale Fixed / 100


    And The Final Answer =675.20+1.30*43.10*31.99+10300*101/100=952467

    I Will Be Great Full If Some One Can create This Script For Me


    Regards
    Kikan
     
    KIKAN, Apr 10, 2007 IP
  2. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Umm... I guess you mean something like this?

    
    <input id="i1" type="text" />
    <input id="i2" type="text" />
    <input type="button" onclick="calculate();" />
    
    <script type="text/javascript">
    function calculate() {
    var myAnswer = 
       eval(document.getElementById("i1").value) + 
       1.3 *
       eval(document.getElementById("i2").value) *
       43.10 * 31.99 + 10300 * 101 / 100;
    alert(myAnswer);
    }
    </script>
    
    Code (markup):
     
    giraph, Apr 10, 2007 IP
  3. KIKAN

    KIKAN Peon

    Messages:
    92
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This Is Not Working I Made One But Dont Know Whats Wrong When I Add 1.30

     
    KIKAN, Apr 10, 2007 IP
  4. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #4
    From looking at your code I think you need...

    
    var Gold = eval(document.frmData.Gold.value)
    var Exchange = eval(document.frmData.Exchange.value)
    
    Code (markup):
     
    giraph, Apr 10, 2007 IP
  5. KIKAN

    KIKAN Peon

    Messages:
    92
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i Also Didn't Work Sir
     
    KIKAN, Apr 10, 2007 IP
  6. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #6
    giraph, Apr 10, 2007 IP