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 September 15th, 2009, 10:37 AM
Registered User
 
Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Firefox issue defining values

Ok this issue is really weird to me

i have a line
appObj.myName = document.getElementById("docName").value;

The first time i run through the function it sets the value of docName.value to appObj.myName, but the second time i run through the value appObj.myName comes back undefined, this works fine in IE.

I have been working on this for 24 hours and cannot find the bug can anybody help

Thanks
 
Old September 15th, 2009, 06:43 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Too many possible reasons.

For example, if you create a *second* object with ID="docName" *after* the first time through that function, then FF will act differently than IE.

You will need to show the full code. If possible, post it "live" someplace and give us the URL.
 
Old September 16th, 2009, 03:42 PM
Registered User
 
Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ill post the full code tomorrow when i get back to work
Thanks for the reply
 
Old September 17th, 2009, 10:32 AM
Registered User
 
Join Date: Aug 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok here is the full function

function tokenizeData() {


appData.flowName = document.getElementById("flowName").value;
appData.dueDate = document.getElementById("flowDueDate").value;
appData.comments = document.getElementById("comments").value;
appData.emailText = document.getElementById("emailText").value;
appData.notificationCode = document.getElementById("notificationCode").value;
appData.status = getCtl("flowStatus").innerHTML;


appDataTok = new StringBuffer();
appDataTok.append("{");
appDataTok.append("'ApprovalPk' : '").append(appData.flowPk).append("',");
appDataTok.append("'FlowName' : '").append(formatString(appData.flowName)).append( "',");
appDataTok.append("'DueDate' : '").append(appData.dueDate).append("',");
appDataTok.append("'ApprovalState' : '").append(appData.status).append("',");
appDataTok.append("'OriginatorEmpId' : '<%=userData.empId%>',");
appDataTok.append("'Originator' : '<%=userData.name%>',");
appDataTok.append("'EmailText' : '").append(formatString(appData.emailText)).append ("',");
appDataTok.append("'OriginatorComment' : '").append(formatString(appData.comments)).append( "',");
appDataTok.append("'NotificationStateCode' : '").append(appData.notificationCode).append("', ");
appDataTok.append("'Docs' : [");
appDataTok.append("{'DocReference' : '").append(escape(document.getElementById('doc.0') .value)).append("'}");


var urlTable = document.getElementById("docUrls");
for (var i=0; i<urlTable.rows.length; i++) {
if (i!=0)
{
var rowIdSplit = urlTable.rows[i].id.split(".");
var rowId = Number(rowIdSplit[1]);

var docRef = document.getElementById('doc.' +rowId).value; ;

if (docRef.trim() != "") {
added = true;
appDataTok.append(",{'DocReference' : '").append(escape(docRef)).append("'}");
}
}
}
appDataTok.Append("]");
appDataTok.Append("}");


//--------------------------------------------------
attsTok = new StringBuffer();
attsTok.Append("[");
for (var g=0; g<atts.length; g++) {
if (atts[g].originatorReviewerFlag == "R")
continue;
attsTok.Append("{");
attsTok.append("'GroupName' : '").append(atts[g].groupName).append("', 'Fields' : [ ");
for (var f=0; f<atts[g].fields.length; f++) {

attsTok.append("{");
attsTok.append("'FieldName' : '").append(atts[g].fields[f].fieldName).append("',");
var el = document.getElementById(atts[g].fields[f].fieldName);
var curVal;
if (atts[g].fields[f].type == "boolean")
curVal = el.checked;
else if (atts[g].fields[f].type == "date")
{
if (isDate(el.value,2,atts[g].fields[f].fieldName) == false)
{
document.getElementById('status').innerHTML = "";
//alert("The date format " + atts[g].fields[f].fieldName + " should be : yyyy-mm-dd");
setActiveTab(2);
el.focus();
attsTok = "";
return false;
}

curVal =el.value;
}

else curVal = el.value;

if (atts[g].fields[f].type != "number")
{
if (checkSpecialChar(el.value) == true)
{
alert(atts[g].fields[f].fieldName + " contains special characters (',~) which are not allowed");
el.focus();
return false;
}
}

attsTok.append("'CurVal' : '").append(curVal).append("'");
attsTok.append("}");
if (f < (atts[g].fields.length - 1)) attsTok.append(",");
}
attsTok.Append("]"); // end field list
attsTok.Append("}"); // end group object
if (g < (atts.length - 1)) attsTok.append(",");
}
attsTok.Append("]");

//--------------------------------------------------
appSetsTok = new StringBuffer();
var strAppsetSplit;
var asRowID; // appset rowid
var asmTable = document.getElementById('approverSetTable');
appSetsTok.Append("[");
if (appSets) {
for (var s=0; s<asmTable.rows.length; s++) {

strAppsetSplit = asmTable.rows[s].id.split(".");
asRowID = strAppsetSplit[1];

var asTable = document.getElementById('asTable.' + asRowID);
if (asTable.rows.length >0)
{
appSetsTok.append("{");
var el = document.getElementById('asDueDate.' + asRowID);

if (isDate(el.value,3,"") == false)
{
document.getElementById('status').innerHTML = "";
appSetsTok = ""
if (el.disabled != true)
{
el.focus();
}
return false;
}


appSetsTok.append("'RevSetDueDate' : '").append(el.value).append("',");
el = document.getElementById('firstResp.' + asRowID);
appSetsTok.append("'FirstResponseOnlyFlag' : '").append(el.value).append("',");
appSetsTok.append("'ApproverSetNum' : '").append(asRowID).append("',");
appSetsTok.append("'Reviewers' : [");

for (var r=1; r<asTable.rows.length; r++) {
var revNum = asTable.rows[r].cells[5].innerHTML;
var empId = asTable.rows[r].cells[6].innerHTML;
var originatorNotified = asTable.rows[r].cells[7].innerHTML;
if (r > 1) appSetsTok.append(",");
appSetsTok.append("{");
el = document.getElementById('person.' + asRowID + "." + revNum);
appSetsTok.append("'Name' : '").append(el.innerHTML).append("',");
el = document.getElementById('role.' + asRowID + "." + revNum);
appSetsTok.append("'ReviewerRole' : '").append(el.value).append("',");
el = document.getElementById('jobFunction.' + asRowID + "." + revNum);
appSetsTok.append("'JobFunction' : '").append(el.value).append("',");
el = document.getElementById('status.' + asRowID + "." + revNum);
appSetsTok.append("'Status' : '").append(el.innerHTML).append("',");
appSetsTok.append("'EmployeeId' : '").append(empId).append("',");
appSetsTok.append("'OriginatorNotified' : '").append(originatorNotified).append("'");
appSetsTok.append("}");
}
appSetsTok.Append("]}");
if (s < (asmTable.rows.length - 1)) appSetsTok.append(",");
}
}
}
appSetsTok.Append("]");
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Defining restrictions based on element/attribute values aldwinenriquez XML 3 May 13th, 2009 03:55 AM
Firefox issue timeout08 Dreamweaver (all versions) 2 September 29th, 2008 02:55 PM
DREAMWEAVER/FIREFOX ISSUE PSRIGLEY Dreamweaver (all versions) 9 May 24th, 2008 11:37 AM
Firefox v. IE CrystalReportViewer Issue melbsurfer Crystal Reports 1 October 20th, 2006 09:31 AM
Firefox issue Teessider_2000 HTML Code Clinic 6 September 20th, 2006 03:32 AM





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