Click here to Skip to main content
15,357,358 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello ALL
i have this script its work good in asp but i try the same example in php but its not work whats the problem .. plz help

JavaScript
<script type="text/javascript">

       function Calculate() {
           var Txt_Percent = document.getElementById('<%= txt_Percent.ClientID %>');
           var Txt_Fix = document.getElementById('<%= txt_Fix.ClientID %>');
           if (document.getElementById('<%= rad_Fix.ClientID %>').checked == true) {
               document.getElementById('txt_Percent').disabled = true;

               var lblReadCost = document.getElementById('<%= lbl_Read_Cost.ClientID %>');

               var lblReadCostValue;
               var Lab_Read_Net = document.getElementById('<%= lbl_Read_Net.ClientID %>');
               var hf_Read_Net = document.getElementById('<%= hf_Read_Net.ClientID %>');


               if (navigator.appName == 'Netscape')
                   lblReadCostValue = lblReadCost.textContent;
               else
                   lblReadCostValue = lblReadCost.innerText;





               if (navigator.appName == 'Netscape')
                   Lab_Read_Net.textContent = (eval(lblReadCostValue) - eval(Txt_Fix.value));
               else
                   Lab_Read_Net.innerText = (eval(lblReadCostValue) - eval(Txt_Fix.value));

               hf_Read_Net.value = (eval(lblReadCostValue) - eval(Txt_Fix.value));

               if (document.getElementById('<%= txt_Fix.ClientID %>').value == '') {
                   Lab_Read_Net.innerText = (eval(lblReadCostValue));
               }



           }

           if (document.getElementById('<%= rad_Percent.ClientID %>').checked == false) {

               Txt_Percent.value = "";
           }


       }
     
    </script>

    <script type="text/ecmascript">

        function Calculate1() {


            var Txt_Fix = document.getElementById('<%= txt_Fix.ClientID %>');
            var Txt_Percent = document.getElementById('<%= txt_Percent.ClientID %>');

            if (document.getElementById('<%= rad_Percent.ClientID %>').checked == true) {
                document.getElementById('txt_Fix').disabled = true;

                var lblReadCost1 = document.getElementById('<%= lbl_Read_Cost.ClientID %>');
                var lblReadCostValue1;

                var Lab_Read_Net = document.getElementById('<%= lbl_Read_Net.ClientID %>');
                var hf_Read_Net = document.getElementById('<%= hf_Read_Net.ClientID %>');


                if (navigator.appName == 'Netscape')
                    lblReadCostValue1 = lblReadCost1.textContent;
                else
                    lblReadCostValue1 = lblReadCost1.innerText;


                if (navigator.appName == 'Netscape')
                    Lab_Read_Net.textContent = (eval(lblReadCostValue1) - eval(Txt_Percent.value));




                var x = (eval(lblReadCostValue1) * eval(Txt_Percent.value) / 100);

                Lab_Read_Net.innerText = (eval(lblReadCostValue1) - parseInt(x));


                hf_Read_Net.value = (eval(lblReadCostValue1) - parseInt(x));

                if (document.getElementById('<%= txt_Percent.ClientID %>').value == '') {
                    Lab_Read_Net.innerText = (eval(lblReadCostValue1));
                }
            }




            if (document.getElementById('<%= rad_Fix.ClientID %>').checked == false) {

                Txt_Fix.value = "";
            }



        }
    </script>
Posted
Updated 21-May-22 9:26am
Comments
Kornfeld Eliyahu Peter 11-Feb-14 4:23am
   
Convert a mammal into a bird...
Member 10405755 11-Feb-14 4:33am
   
can u explain more what u mean exactly?
Kornfeld Eliyahu Peter 11-Feb-14 4:36am
   
You have to learn PHP...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900