Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2005, 02:06 AM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nlpatel78
Default Problem with IE 6.0.2900.2180 with innerCell()

Dear Friends i am using insertCell() javascript to generate Dynamically table and it is creating problem while i am using IE version 6.0.2900.2180. so please provide me detail help related to this topic.rest for all browser that is working fine. and my code is as follows.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="ValidateFunctions.js"></script>
<link href="Eilisys.css" rel="STYLESHEET" type="text/css">
<script language="javascript">
var id=1;
var rowNum = 1; // added rowNum var
var strExchangeCurr="";
function insRow(RptExDate,RptExParticular,RptExHead,RptExCu rr,RptExRate,RptExAmount,RptExCDesc,RptExCC,RptExR ate)
{
    var trow=document.getElementById('ExpenseTable').inser tRow(rowNum); // added rowNum arg

    var tdata1=trow.insertCell(0)
    var tdata2=trow.insertCell(1)
    var tdata3=trow.insertCell(2)
    var tdata4=trow.insertCell(3)
    var tdata5=trow.insertCell(4)
    var tdata6=trow.insertCell(5)
    var tdata7=trow.insertCell(6)
    var tdata8=trow.insertCell(7)
    var tdata9=trow.insertCell(8)

    // used concatentation to assign id nums
    tdata1.innerHTML="&nbsp;<input type='text' id='txtExDt" + id + "' style='width:75px;' maxlength='11' class='INPUTALIGNRIGHT' value='"+RptExDate+"' onBlur='checkdate(this);'>"
    tdata2.innerHTML="<input type='text' id='txtExPer" + id + "' style='width:150px;' maxlength='40' class='INPUTALIGNLEFT' value='"+RptExParticular+"'>"
    tdata3.innerHTML="<select id='cmbExHead" + id + "' style='width:150px;'>"+RptExHead+"</select>"
    tdata4.innerHTML="<input type='checkbox' id='chkExCC" + id + "' onClick='Calculate_BRAmount("+id+");'>"
    tdata5.innerHTML="<input type='checkbox' id='chkExRct"+ id + "'>"
    tdata6.innerHTML="<input type='text' id='txtExCurr" + id + "' style='width:38px;' maxlength='3' class='INPUTALIGNLEFT' value='"+RptExCurr+"' onBlur=\"FillExchangeRate(this,'txtExRate"+id+"'); Calculate_BRAmount("+id+");\">" //onblur='FillExchangeRate(this,'txtExRate"+id+"');C alculate_BRAmount("+id+");'
    tdata7.innerHTML="<input type='text' id='txtExRate" + id + "' style='width:62px;' maxlength='10' class='INPUTALIGNRIGHT' value='"+RptExRate+"' onblur='Calculate_BRAmount("+id+");'>" //onblur='Calculate_BRAmount("+id+");'
    tdata8.innerHTML="<input type='text' id='txtExFCAmt" + id + "' style='width:100px;' maxlength='10' class='INPUTALIGNRIGHT' value='"+RptExAmount+"' onfocus='select();' onblur='Calculate_BRAmount("+id+"); this.value=cVal(this.value);'>"
    tdata9.innerHTML="<input type='text' id='txtExLCAmt" + id + "' style='width:100px;' maxlength='10' class='INPUTALIGNRIGHT' value='"+RptExCDesc+"' onBlur='this.value=cVal(this.value);' >"

    tname="txtExDt";
    tname1="txtExPer";
    tname2="cmbExHead";
    tname3="chkExCC"+id;
    tname4="chkExRct"+id;
    tname5="txtExCurr";
    tname6="txtExRate";
    tname7="txtExFCAmt";
    tname8="txtExLCAmt";

    tid="txtExDt"+id;
    tid1="txtExPer"+id;
    tid2="cmbExHead"+id;
    tid3="chkExCC"+id;
    tid4="chkExRct"+id;
    tid5="txtExCurr"+id;
    tid6="txtExRate"+id;
    tid7="txtExFCAmt"+id;
    tid8="txtExLCAmt"+id;

    var txtid = document.getElementById(tid);
    txtid.setAttribute("name",tname);
    var txtid1 = document.getElementById(tid1);
    txtid1.setAttribute("name",tname1);
    var txtid2 = document.getElementById(tid2);
    txtid2.setAttribute("name",tname2);
    var txtid3 = document.getElementById(tid3);
    txtid3.setAttribute("name",tname3);
    var txtid4 = document.getElementById(tid4);
    txtid4.setAttribute("name",tname4);
    var txtid5 = document.getElementById(tid5);
    txtid5.setAttribute("name",tname5);
    var txtid6 = document.getElementById(tid6);
    txtid6.setAttribute("name",tname6);
    var txtid7 = document.getElementById(tid7);
    txtid7.setAttribute("name",tname7);
    var txtid8 = document.getElementById(tid8);
    txtid8.setAttribute("name",tname8);

    id=id+1;
    rowNum++; //new
}
</script>
</head>
<body>
<FORM Name="thisform" Method="Post">
    <Input Type="Hidden" Id="txtRptCurr" Name="txtRptCurr" Value="THB">
    <Input Type="Hidden" Id="txtFlag" Name="txtFlag" Value="">
    <Input type="Hidden" Id="txtDocType" Name="txtDocType" Value="ER">
    <Input Type="Hidden" Id="txtmKey" Name="txtmKey" Value="E164">
    <input type="Hidden" id="myAction" name="myAction" value="E">
    <input type="hidden" id="WanSendMail" name="WanSendMail" value="">
    <input type="hidden" id="LoginMailID" name="LoginMailID" value="[email protected]">
    <Input type="Hidden" Id="txtFilePath" Name="txtFilePath" Value="http://ascentserver/etravel1.0/ExpenseReport.asp">
    <table class="full" border="0" cellspacing="0" cellpadding="0">
        <tr><td>&nbsp;</td></tr>
        <tr>
            <td align="center" width="90%">
                <table width="90%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td valign="top" align="center">
                            <table class="InputOuterTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td align="center">
                                        <table id="ExpenseTable" class="InputTable" width="70%" border="0" cellspacing="0" cellpadding="0">
                                            <tr>
                                                <td nowrap align="center">Date</td>
                                                <td nowrap align="center">Particulars</td>
                                                <td nowrap align="center">Head</td>
                                                <td nowrap align="center">CC</td>
                                                <td nowrap align="center">Rct</td>
                                                <td nowrap align="center">Curr</td>
                                                <td nowrap align="center">Exch Rate</td>
                                                <td nowrap align="center">Amount</td>
                                                <td nowrap align="center">THB</td>
                                            </tr>
                                                <script language="javascript">
                                                    insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');
                                                </script>
                                                <script language="javascript">
                                                    insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');
                                                </script>
                                                <script language="javascript">
                                                    insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');
                                                </script>
                                                <script language="javascript">
                                                    insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');
                                                </script>
                                                <script language="javascript">
                                                    insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');
                                                </script>
                                            <tr>
                                                <td align="left" colspan="7">&nbsp;<input type="button" onclick="insRow('','','<option VALUE=0.00~Selecthead>Select Head</option>','','','','','','');" value="Insert row" class="stdButton"></td>
                                                <td align="right" nowrap><b>Total Expenses :</b></td>
                                                <td align="left"><input type="text" id="txtTotalExpense" class="INPUTALIGNRIGHTWITHCOLOUR" name="txtTotalExpense" style="width:100px;" maxlength="10" value="" readonly></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</form>
</body>
</html>


neel
 
Old March 17th, 2005, 04:07 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you want help I'd suggest you do at least two things
 
  • State the problem more accurately, what exactly is happening or not happening against your expectations?
  • Strip down your code to as small an example as possible that shows the problem



--

Joe (Microsoft MVP - XML)
 
Old March 17th, 2005, 08:19 AM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nlpatel78
Default

Dear Joe thanks for your suggestion.
     may be i was unable to explain my problem but i have pasted my whole page which was creating problem while i am opening that page in IE 6.0.2900.2180 which is only available with microsoft XP service pack 2. so just install XPSP2 and then open this page and then you will see the problem. it doesnt loads all elements in proper sequence. as you see my code combo is on third position. but while u open it it will display on last to second position. so like that all elements will not display in proper order.
     and this is my problem.
thanks
Neel

neel
 
Old March 17th, 2005, 08:59 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Sorry I've tried but it's too unwieldy. Are you just trying to add a select box to the third column?
One other thing to know, nothing to do with your original question, is that you cannot set the name of an input element after creation if you need to post the data back. See remarks in http://msdn.microsoft.com/library/de...ateelement.asp

--

Joe (Microsoft MVP - XML)
 
Old March 18th, 2005, 06:12 AM
Registered User
 
Join Date: Feb 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nlpatel78
Default

Dear Joe,
     Thanks for your help.now i got the solution. actually there was a problem with index. which other browser consider 0 by default and for IE6.0.2900 i have to specify -1.
thaks yaar
:)


neel





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with IE version 6.0.2900.2180 while using nlpatel78 Classic ASP Basics 2 March 16th, 2005 02:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.