Results 1 to 2 of 2

Thread: javascript

  1. #1
    Join Date
    Aug 2009
    Posts
    74
    Thanks
    7
    Thanked 1 Time in 1 Post

    Default javascript

    table border=1width=300>
    <tr><td width=150><strong>W<font size=1> j</font> </td><td width=75 align=center><strong>(gm)</td><td width=75 > <input type=text name=wj size=8 value='' id='wj'></td> </tr>
    <tr><td><strong>W<font size=1>jp</font> </td><td align=center><strong>(gm)</td><td><input type=text name=wjp size=8 value='' id='wjp'> </td> </tr>
    <tr><td><strong>Volume-ini</td><td align=center><strong>(gm)</td><td> <input type=text name=volumeini size=8 value='' id='v1' onblur='getContent("GET","schedulexist.php?wj="+document.getElementById("wj").value+"&wjp="+document.getElementById("wjp").value"&v1="+document.getElementById(" v1").value,"s");'></td></tr>
    <tr><td> <strong>Volume-7 taps</td><td align=center><strong>(gm)</td><td><input type=text name=volumetaps size=8 value='' id='v2' onblur='getContent("GET","scheduexist.php?wj="+document.getElementById("wj").value+"&wjp="+document.getElementById("wjp").value"&v1="+document.getElementById("v 1").value+"&v2="+document.getElementById("v2").value,"t");'></td></tr>
    </table>


    <script language="javascript">
    function validate()
    {


    var ccode,a,b;



    ccode=window.document.reg.v2.value;
    a=window.document.reg.wj.value;
    b=window.document.reg.wjp.value;

    var a1;

    a1=(window.document.reg.wjp.value - window.document.reg.wj.value)/window.document.reg.v2.value
    alert(a1);
    reg.a1.value = (a1);



    }
    </script>


    by this script iam getting a1 value in alert.but what i want is that it must come as normal text value in my table. Is it possible? if anyone knows help me out?

  2. #2
    Join Date
    Apr 2009
    Location
    Cognac, France
    Posts
    400
    Thanks
    2
    Thanked 57 Times in 57 Posts

    Default

    I've only had a quick look at this but you could try the following:

    HTML Code:
    <td><span id="calcvalue">< /span>
    add to your javascript :

    HTML Code:
    document.getElementById('calcvalue').innerHTML = a1;

Bookmarks

Posting Permissions

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