473,626 Members | 3,083 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 1832
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=javascri pt][/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
5093
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 try to open the database from my laptop, I get the warning "Microsoft Access cannot open this file This file is located outside your intranet or on an untrusted site. Microsoft Access will not open the file due to potential security problems. ...
6
2071
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 trusted site. Thanks.
1
1126
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 while at the office. The problem is, when they attempt to access the same pages remotely, they are never prompted for their domain logon. Instead, they are denied access. All of our web pages are asp.net and the ones with issues all use...
1
1807
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
3709
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, Otherwise, the user is required to ignore some warming message. Does anyone know how to detect the current site is in the trusted site list? If not, how can I add the current site into the trusted site list using scripting?
3
4415
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
1366
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
1560
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 will be helpful Thanks!!!
1
3892
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 I have managed to create a bat file that auto adds the required address when run. Pretty soon we will be upgrading our software and the site address used will changed. At the moment the site address is http://localhost, after upgrade the site...
0
8259
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8192
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6119
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4090
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2621
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 we have to send another system
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.