473,500 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trusted Site Not So Trusted

2 New Member
I have a script that uses createelement to insert new rows into a page. Those inserted rows also have onchange events that fire, validating the identity of an account. The problem is that while pre-rendered rows (ones actually embedded into the HTML) will fire the onblur event, while any rows added via the javascript function will not even pop up an alert box.

The site is added to trusted sites, and active scripting is working on that zone. The bizarre thing is that if I set the internet zone to allow active scripting, events can fire from the inserted rows without any problem. But as soon as that is turned back to disable (necessary in this company) then those inserted rows do not work anymore.

Here is the function in question:
Expand|Select|Wrap|Line Numbers
  1. function addRow(table_id, neighborhood, agent_id, ledger_type, ledger_type_label)
  2. {
  3.     var tbody = document.getElementById(table_id).getElementsByTagName("tbody")[0];
  4.     var row = document.createElement("TR");
  5.     row.id='add_row_'+document.getElementById('additionalRowCount').value;
  6.     document.getElementById('additionalRowCount').value=document.getElementById('additionalRowCount').value+1;
  7.     row.style.backgroundColor='#F6F6f6';
  8.  
  9.     var cell1 = document.createElement("TD");
  10.     var inp1 =  document.createElement("<INPUT TYPE='text' value='' size='24' maxlength='24' name='ledger_num"+ledger_type+"[]' class='textfield1' id='textaddMsgRow"+row.id+"' onChange='checkAccountNumber(this.value, \""+neighborhood+"\",\"addMsgRow"+row.id+"\",\""+agent_id+"\",\""+ledger_type_label+"\")'>");
  11.     var lineBreak = document.createElement("BR");
  12.     var accountDescSpan = document.createElement("span");
  13.     accountDescSpan.id="addMsgRow"+row.id+"_desc";
  14.     cell1.width="190";
  15.     cell1.valign="top"
  16.     cell1.appendChild(inp1);
  17.  
  18.     var lookupLink=document.createElement("a");
  19.     lookupLink.href="javascript:MM_openBrWindow('lookup/lookup_account_number.php?company="+neighborhood+"&fromID=addMsgRow"+row.id+"&ledger_type="+ledger_type_label+"','lookup','width=480,height=380');void(0)";
  20.  
  21.     var lookupImage=document.createElement("IMG");
  22.     lookupImage.src="../../../images/buttons/icon_table.gif";
  23.     lookupImage.border="0";
  24.     lookupImage.width="16";
  25.     lookupImage.height="16";
  26.  
  27.     lookupLink.appendChild(lookupImage);
  28.     cell1.appendChild(lookupLink);
  29.     cell1.appendChild(lineBreak);
  30.     cell1.appendChild(accountDescSpan);
  31.  
  32.     var cell2 = document.createElement('<TD width="20" valign="top">');
  33.     var inp2 =  document.createElement("INPUT");
  34.     inp2.type="text";
  35.     inp2.value="";
  36.     inp2.size="10";
  37.     inp2.maxlength="10";
  38.     inp2.name="ledger_amount"+ledger_type+"[]";
  39.     inp2.className="textfield1";
  40.     //cell2.width="20";
  41.     //cell2.setAttribute("valign","top");
  42.     cell2.appendChild(inp2);
  43.  
  44.     var cell3 = document.createElement('<TD width="50" valign="top">');
  45.     var inp3 =  document.createElement('<INPUT type="text" value="" size="24" maxlength="30" name="ledger_explanation'+ledger_type+'[]" class="textfield1">');
  46.     /*inp3.type="text";
  47.     inp3.value="";
  48.     inp3.size="24";
  49.     inp3.maxlength="30";
  50.     inp3.name="ledger_explanation[]";*/
  51.     inp3.className="textfield1";
  52.     //cell3.width="50";
  53.     //cell3.valign="top"
  54.     cell3.appendChild(inp3);
  55.  
  56.     var cell4 = document.createElement('<TD width="90" valign="top">');
  57.     var inp4 =  document.createElement("INPUT");
  58.     var inp4 =  document.createElement("<INPUT TYPE='text' value='' size='10' maxlength='10' name='sub_ledger"+ledger_type+"[]' class='textfield1' id='addMsgRow"+row.id+"SubLedger' onChange='checkPostingEditCode(\"messagesTable\", \"addMsgRow"+row.id+"\");checkSubledger(\"addMsgRow"+row.id+"SubLedgerMsg\", this.value, document.getElementById(\"addMsgRow"+row.id+"SubType\").options[document.getElementById(\"addMsgRow"+row.id+"SubType\").selectedIndex].value, \"addMsgRow"+row.id+"SubLedger\", \"addMsgRow"+row.id+"SubType\",\""+ledger_type_label+"\");'>");
  59.     //cell4.width="90";
  60.     //cell4.valign="top"
  61.     cell4.appendChild(inp4);
  62.  
  63.     var cell5 = document.createElement('<TD valign="top">');
  64.     var objSelect =  document.createElement("<SELECT name='sub_type"+ledger_type+"[]' id='addMsgRow"+row.id+"SubType' onChange='checkPostingEditCode(\"messagesTable\", \"addMsgRow"+row.id+"\");checkSubledger(\"addMsgRow"+row.id+"SubLedgerMsg\", document.getElementById(\"addMsgRow"+row.id+"SubLedger\").value, this.options[this.selectedIndex].value, \"addMsgRow"+row.id+"SubLedger\", \"addMsgRow"+row.id+"SubType\",\""+ledger_type_label+"\");'>");
  65.  
  66.     var objOptionDefault = document.createElement("OPTION");
  67.     objOptionDefault.text="-";
  68.     objOptionDefault.value="";
  69.     objSelect.options.add(objOptionDefault);
  70.  
  71.     var objOptionA = document.createElement("OPTION");
  72.     objOptionA.text="A";
  73.     objOptionA.value="A";
  74.     objSelect.options.add(objOptionA);
  75.  
  76.     var objOptionC = document.createElement("OPTION");
  77.     objOptionC.text="C";
  78.     objOptionC.value="C";
  79.     objSelect.options.add(objOptionC);
  80.  
  81.     var objOptionX = document.createElement("OPTION");
  82.     objOptionX.text="X";
  83.     objOptionX.value="X";
  84.     objSelect.options.add(objOptionX);
  85.  
  86.     var link=document.createElement("a");
  87.     link.href="javascript:deleteRow('"+row.id+"', '"+ledger_type_label+"');void(0)";
  88.  
  89.     objSelect.className="textfield2";
  90.     var imageObj=document.createElement("IMG");
  91.     imageObj.src="../../../images/options/minus1.gif";
  92.     imageObj.border="0";
  93.  
  94.     cell5.appendChild(objSelect);
  95.     link.appendChild(imageObj);
  96.     cell5.appendChild(link);
  97.  
  98.     var inp5 =  document.createElement("INPUT");
  99.     inp5.type="hidden";
  100.     inp5.value="";
  101.     inp5.id="addMsgRow"+row.id+"PEC";
  102.     inp5.name="pec[]";
  103.     cell5.appendChild(inp5);
  104.  
  105.     var inp6 =  document.createElement("INPUT");
  106.     inp6.type="hidden";
  107.     inp6.value="no";
  108.     inp6.id="addMsgRow"+row.id+"PECCheck";
  109.     cell5.appendChild(inp6);
  110.     cell5.width="50";
  111.  
  112.     row.appendChild(cell1);
  113.     row.appendChild(cell2);
  114.     row.appendChild(cell3);
  115.     row.appendChild(cell4);
  116.     row.appendChild(cell5);
  117.     tbody.appendChild(row);
  118. }
  119.  
Has anyone else had problems with javascript-inserted content being treated as internet zone instead of trusted zone?
Oct 18 '07 #1
3 1817
epots9
1,351 Recognized Expert Top Contributor
i couldn't find where you're setting the onblur attribute, what part is it and please use javascript code ([code=javascript][/code])tags
Oct 18 '07 #2
loganfoster
2 New Member
i couldn't find where you're setting the onblur attribute, what part is it and please use javascript code ()tags
My apologies, I meant onChange. I tried testing out onBlur just now to see if I could even get an alert box to fire, which it wouldn't.

Am I not using code tags above? I thought that I was.
Oct 18 '07 #3
epots9
1,351 Recognized Expert Top Contributor
your createElement statement it wrong
Expand|Select|Wrap|Line Numbers
  1. var inp1 =  document.createElement("<INPUT TYPE='text' value='' size='24' maxlength='24' name='ledger_num"+ledger_type+"[]' class='textfield1' id='textaddMsgRow"+row.id+"' onChange='checkAccountNumber(this.value, \""+neighborhood+"\",\"addMsgRow"+row.id+"\",\""+agent_id+"\",\""+ledger_type_label+"\")'>");
  2.  
try
Expand|Select|Wrap|Line Numbers
  1. var inp1 = document.createElement("input");
  2. inp1.type = "text";
  3. inp1.size = "24";
  4. inp1.maxlength = "24";
  5. inp1.name = "ledger_num" + ledger_type + "[]";
  6. inp1.class = "textfield1";
  7. inp1.id = "textaddMsgRow" + row.id;
  8. inp1.onchange = function(){checkAccountNumber(this.value, neighborhood, "addMsgRow" + row.id, agent_id, ledger_type_label);}
  9.  
give that a test and tell us how it goes,

good luck
Oct 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5085
by: RWC | last post by:
Hello, I have a database that I need to connect with that resides on my personal intranet server. I'm on a different subnet than this server (running through two different gateways). When I...
6
2058
by: T. | last post by:
Hi, Is there a way that I can add a url to the trusted site list on client workstations? This is for an internal web app, and there are some ActiveX objects that would require it to be a...
1
1112
by: Larry Page | last post by:
OK, I've searched and I'm stumped. Many of or intranet users have configured our portal as a 'trusted site' in their browsers. This keeps them from getting prompted to logon when accessing pages...
1
1790
by: trpost | last post by:
Is there any way using javascript to prompt a user to add a site as a trusted site when they access the page if it is not already trusted?
2
3705
by: Kam | last post by:
I am using SQL Server 2000 Analysis services and Office Web Components to display the information. when the user first time access the web site, he/she did to add it into the trusted site list,...
3
4391
by: dlawner | last post by:
Anyone know a way to determine if a particular url is a trusted site using javascript? I need to validate that a site is trusted before the user logs on.
7
1353
by: Kirsten | last post by:
I have an Access app that I want to distribute to some user. What can I do so that they don't run into Not a Trusted Site error?
5
1550
by: wizzapp | last post by:
Hi guys i wanna know if there are any trusted sites for downloading free service pack updates. my computer has service pack one and no anti-virus software hel me protect my computer. any suggestions...
1
3883
by: simonsmith | last post by:
Hi All, Looking for a bit of help. The web based software my company uses (Siebel platform) is required to have its site address added as a trusted site. At the moment it is a generic address and...
0
7136
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7232
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5490
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4611
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1430
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.