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: -
function addRow(table_id, neighborhood, agent_id, ledger_type, ledger_type_label)
-
{
-
var tbody = document.getElementById(table_id).getElementsByTagName("tbody")[0];
-
var row = document.createElement("TR");
-
row.id='add_row_'+document.getElementById('additionalRowCount').value;
-
document.getElementById('additionalRowCount').value=document.getElementById('additionalRowCount').value+1;
-
row.style.backgroundColor='#F6F6f6';
-
-
var cell1 = document.createElement("TD");
-
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+"\")'>");
-
var lineBreak = document.createElement("BR");
-
var accountDescSpan = document.createElement("span");
-
accountDescSpan.id="addMsgRow"+row.id+"_desc";
-
cell1.width="190";
-
cell1.valign="top"
-
cell1.appendChild(inp1);
-
-
var lookupLink=document.createElement("a");
-
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)";
-
-
var lookupImage=document.createElement("IMG");
-
lookupImage.src="../../../images/buttons/icon_table.gif";
-
lookupImage.border="0";
-
lookupImage.width="16";
-
lookupImage.height="16";
-
-
lookupLink.appendChild(lookupImage);
-
cell1.appendChild(lookupLink);
-
cell1.appendChild(lineBreak);
-
cell1.appendChild(accountDescSpan);
-
-
var cell2 = document.createElement('<TD width="20" valign="top">');
-
var inp2 = document.createElement("INPUT");
-
inp2.type="text";
-
inp2.value="";
-
inp2.size="10";
-
inp2.maxlength="10";
-
inp2.name="ledger_amount"+ledger_type+"[]";
-
inp2.className="textfield1";
-
//cell2.width="20";
-
//cell2.setAttribute("valign","top");
-
cell2.appendChild(inp2);
-
-
var cell3 = document.createElement('<TD width="50" valign="top">');
-
var inp3 = document.createElement('<INPUT type="text" value="" size="24" maxlength="30" name="ledger_explanation'+ledger_type+'[]" class="textfield1">');
-
/*inp3.type="text";
-
inp3.value="";
-
inp3.size="24";
-
inp3.maxlength="30";
-
inp3.name="ledger_explanation[]";*/
-
inp3.className="textfield1";
-
//cell3.width="50";
-
//cell3.valign="top"
-
cell3.appendChild(inp3);
-
-
var cell4 = document.createElement('<TD width="90" valign="top">');
-
var inp4 = document.createElement("INPUT");
-
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+"\");'>");
-
//cell4.width="90";
-
//cell4.valign="top"
-
cell4.appendChild(inp4);
-
-
var cell5 = document.createElement('<TD valign="top">');
-
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+"\");'>");
-
-
var objOptionDefault = document.createElement("OPTION");
-
objOptionDefault.text="-";
-
objOptionDefault.value="";
-
objSelect.options.add(objOptionDefault);
-
-
var objOptionA = document.createElement("OPTION");
-
objOptionA.text="A";
-
objOptionA.value="A";
-
objSelect.options.add(objOptionA);
-
-
var objOptionC = document.createElement("OPTION");
-
objOptionC.text="C";
-
objOptionC.value="C";
-
objSelect.options.add(objOptionC);
-
-
var objOptionX = document.createElement("OPTION");
-
objOptionX.text="X";
-
objOptionX.value="X";
-
objSelect.options.add(objOptionX);
-
-
var link=document.createElement("a");
-
link.href="javascript:deleteRow('"+row.id+"', '"+ledger_type_label+"');void(0)";
-
-
objSelect.className="textfield2";
-
var imageObj=document.createElement("IMG");
-
imageObj.src="../../../images/options/minus1.gif";
-
imageObj.border="0";
-
-
cell5.appendChild(objSelect);
-
link.appendChild(imageObj);
-
cell5.appendChild(link);
-
-
var inp5 = document.createElement("INPUT");
-
inp5.type="hidden";
-
inp5.value="";
-
inp5.id="addMsgRow"+row.id+"PEC";
-
inp5.name="pec[]";
-
cell5.appendChild(inp5);
-
-
var inp6 = document.createElement("INPUT");
-
inp6.type="hidden";
-
inp6.value="no";
-
inp6.id="addMsgRow"+row.id+"PECCheck";
-
cell5.appendChild(inp6);
-
cell5.width="50";
-
-
row.appendChild(cell1);
-
row.appendChild(cell2);
-
row.appendChild(cell3);
-
row.appendChild(cell4);
-
row.appendChild(cell5);
-
tbody.appendChild(row);
-
}
-
Has anyone else had problems with javascript-inserted content being treated as internet zone instead of trusted zone?
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
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.
epots9 1,351
Recognized Expert Top Contributor
your createElement statement it wrong -
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+"\")'>");
-
try -
var inp1 = document.createElement("input");
-
inp1.type = "text";
-
inp1.size = "24";
-
inp1.maxlength = "24";
-
inp1.name = "ledger_num" + ledger_type + "[]";
-
inp1.class = "textfield1";
-
inp1.id = "textaddMsgRow" + row.id;
-
inp1.onchange = function(){checkAccountNumber(this.value, neighborhood, "addMsgRow" + row.id, agent_id, ledger_type_label);}
-
give that a test and tell us how it goes,
good luck
Sign in to post your reply or Sign up for a free account.
Similar topics |
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. ...
|
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.
|
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...
|
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?
|
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?
| |
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.
|
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?
|
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!!!
|
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...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |