Solved

Access Denied Error

Posted on 2007-03-23
26
558 Views
Last Modified: 2007-11-27
I have a file upload program written in perl. Before I allow the input, I run the file the user has supplied to the text box file through the javascript shown below. The script works fine if the user uses the browse button and selects a valid file and paht.

 If the user does not select a valid path, the following javascript works fine, but then if you try to exit the module by clicking say:<a href="javascript:Manage('Letters')">Letters &nbsp;</a>,  IE gives me an "Access Denied Error"

Any help would be appreciated:

Here is the code:
function Addfile(){
      errfound = false;
      if (!ValidLength(document.info.FILE1.value,5)) {
            error(document.info.FILE1,"You didn't enter a file or valid path for Upload.");
            document.info.FILE1.value = ""; }

      var re = /.jpg|.jpeg|.gif/ig;
      if (!re.test(document.info.FILE1.value)) {
          error(document.info.FILE1,"Only gif, jpg and jpeg files can be uploaded");
          document.info.FILE1.value = ""; }
         
      re = /:/;
      if (!re.test(document.info.FILE1.value)) {
          error(document.info.FILE1,"Please enter a valid path on your local computer system.");
           document.info.FILE1.value = "";
           }
         
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "A";
            document.info.method = "POST";
            document.info.enctype = "multipart/form-data";
            document.info.submit();
      }
}

If I now call this function as stated above, (i.e. <a href="javascript:Manage('Letters')">Letters &nbsp;</a>) after receiving the error messages above due to say just entering flowers.jpg, I receive the "Access Denied" error.

function Manage(x){
      document.info.fn_category.value = x;
      document.info.fn_edit.value = "Listing";
      document.info.action = "https://www.mysite.com/cgi-bin/you/theentries.cgi";
      document.info.method = "POST";
      document.info.submit();
}


0
Comment
Question by:nhtahoe
  • 11
  • 9
  • 2
  • +1
26 Comments
 
LVL 11

Expert Comment

by:flipz
ID: 18780260
Wel the files are uploaded do they all get saved into the same directory on the server?
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18780267
That is a built in security feature. You cannot set fileUploadControl attributes and values by Script.
If you would be allowed to do so then you could set also following upload files without asking me: myPassword.txt, myCreditCard.cache and so on.

0
 
LVL 11

Expert Comment

by:flipz
ID: 18780291
That makes sense.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18780301
And if all you want to do is to reset the file value to zero to nothing to empty string, then it will also block that control from further use (or the complete form from upload).

But there is a trick for that situation: recreate the wrong selected file upload control from scratch!
You can do that by dynamic html or some parent element, span or div or <p> and reset the innerHTML of that element. That gives to you a fresh virgin fileUploadControl.


0
 

Author Comment

by:nhtahoe
ID: 18780348
Thanks for the replies.
Zvonko:
Not sure what you meant by:
"You cannot set fileUploadControl attributes and values by Script."

Are you talking about this line?
document.info.enctype = "multipart/form-data";
I just commented this line out but no change.

And could you perhaps provide a code snippet for what you are talking about in your last post.
0
 

Author Comment

by:nhtahoe
ID: 18780379
Also, this is only a problem in IE. FF works fine.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18780380
This line is the show stopper:

     document.info.FILE1.value = "";

After that assignment is that file upload control unusable and you get that Access Denied error.

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18780401
Show your html source where that input type=file element is embedded and I can show you how the trick works.

 
0
 

Author Comment

by:nhtahoe
ID: 18780648
<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" value=>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 18780837
And if you look in the FF javascript console you will see

Error: uncaught exception: [Exception... "Security error"  code: "1000" nsresult: "0x805303e8 (NS_ERROR_DOM_SECURITY_ERR)"  location: "..... Line: ...."]
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18780894
You did NOT show where your input field is EMBEDDED.
You showed only the input field.
OK, then check this:

<span><INPUT TYPE="file" NAME="FILE1" class="btn" size="50" ></span>


function Addfile(){
      var fileField = document.info.FILE1;
      errfound = false;
      if (!ValidLength(fileField.value,5)) {
            error(fileField,"You didn't enter a file or valid path for Upload.");
            fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }

      var re = /.jpg|.jpeg|.gif/ig;
      if (!re.test(fileField.value)) {
          error(fileField,"Only gif, jpg and jpeg files can be uploaded");
          fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }
         
      re = /:/;
      if (!re.test(fileField.value)) {
          error(fileField,"Please enter a valid path on your local computer system.");
          fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }
         
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "A";
            document.info.method = "POST";
            document.info.enctype = "multipart/form-data";
            document.info.submit();
      }
}




0
 

Author Comment

by:nhtahoe
ID: 18780995
Sorry Zvonk:, I did not understand what you meant by:

You did NOT show where your input field is EMBEDDED.

Also, when I use the code, I'm getting the javascript error:
Getting "parentNode is null or not an object"  in IE

and in Firefox:

Error: fileField.parentNode has no properties
Source File: https://www.mysite.com/cgi-bin/you/manageFiles.cgi
Line: 124

Not sure how to correct this.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 63

Accepted Solution

by:
Zvonko earned 250 total points
ID: 18781056
Did you put the <span> tags around the <input type=file> field like I proposed?

Also after the field is scrached you cannot use it anymore.
Therefore change my script to this more robust version:

<span><INPUT TYPE="file" NAME="FILE1" class="btn" size="50" ></span>


function Addfile(){
      var fileField = document.info.FILE1;
      errfound = false;
      if (!ValidLength(fileField.value,5)) {
            error(fileField,"You didn't enter a file or valid path for Upload.");
            fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }

      var re = /.jpg|.jpeg|.gif/ig;
      if (!errfound && !re.test(fileField.value)) {
          error(fileField,"Only gif, jpg and jpeg files can be uploaded");
          fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }
         
      re = /:/;
      if (!errfound && !re.test(fileField.value)) {
          error(fileField,"Please enter a valid path on your local computer system.");
          fileField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      }
         
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "A";
            document.info.method = "POST";
            document.info.enctype = "multipart/form-data";
            document.info.submit();
      }
}


0
 

Author Comment

by:nhtahoe
ID: 18781125
Yes,:
<span><INPUT TYPE="file" NAME="FILE1" class="btn" size="50" ></span>

Okay, tried the script above, but now it won't let me upload any files. (But at least it is not giving me the "Access Denied" errot :~>)
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18781177
Put before the submit() method an alert() telling that it is trying to submit.

0
 

Author Comment

by:nhtahoe
ID: 18781196
No, it never gets there and no idea why....
0
 

Author Comment

by:nhtahoe
ID: 18781223
changed:

function Addfile(){
      var fileField = document.info.FILE1;

to:

function Addfile(){
      var fileField = document.info.FILE1.value;

so I can upload again, but still getting the
"parentNode is null or not an object"  in IE

0
 

Author Comment

by:nhtahoe
ID: 18781312
This actually works both in IE and FF. Though in FF, I am getting the error message:

Error: someField.parentNode has no properties
Source File: https://www.youdeparted.com/cgi-bin/you/manageFiles.cgi
Line: 126

but it does work in both. So...have any ideas why I'm getting this message?

function Addfile(){
      var fileField = document.info.FILE1.value;
      var someField = document.info.FILE1;
      errfound = false;
     
      if (!ValidLength(fileField,5)) {
            alert("You didn't enter a file or valid path for Upload.");
            someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
            errfound=true;
            }
      var re = /.jpg|.jpeg|.gif/ig;
      if (!re.test(fileField)) {
          alert("Only gif, jpg and jpeg files can be uploaded");
          someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
          errfound=true;
          }
         
       re = /\:/;
       if (!re.test(fileField)) {
            alert("Please enter a valid path on your local computer system.");
            someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
            errfound=true;
            }
         
      Demo();
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "A";
            document.info.method = "POST";
            // document.info.enctype = "multipart/form-data";
            document.info.submit();
      }
}
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18781419
Can you show the complette page source or a live URL to the page?

0
 

Author Comment

by:nhtahoe
ID: 18782232
Here is the source. Because the site is still in beta, if you want the actual link, send me an email at <email address removed> if this would help. I just don't want to post it on the public forum quite yet.

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                        "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>mysite.com Image Manager</TITLE>

<link href="https://www.mysite.com/css/smain.css" rel="stylesheet" type="text/css">
<link href="https://www.mysite.com/css/member/Account.css" rel="stylesheet" type="text/css" />

<script language="JavaScript"  type="text/javascript">

function getCookie(NameOfCookie){
var begin;
if (document.cookie.length > 0) {
      begin = document.cookie.indexOf(NameOfCookie+"=");
      if (begin != -1) {
            begin += NameOfCookie.length+1;
            end = document.cookie.indexOf(";", begin);
            if (end == -1) end = document.cookie.length;
            return unescape(document.cookie.substring(begin, end)); }
}
return null;
}

function FindCookie(){
      var userinfo=getCookie('CGISESSID');
      if (userinfo == null || userinfo == "") {
                  var browserName=navigator.appName;
                  if (browserName=="Netscape") {
                        top.location.href = 'https://www.mysite.com/login.php&TARGET=_top';
                        self.close(); }
                  var d = window.top.document;
                  d.open("text/html");
                  d.write("");
                  d.close();
                  location.replace("https://www.mysite.com/login.php")
             }
}

function LogMeOut(){
//            document.info.action = "https://www.mysite.com/cgi-bin/you/logout.cgi";
            top.location.href = 'https://www.mysite.com/cgi-bin/you/logout.cgi?username=johnson&fn_which=1';
            
}

function doLoad()
{
    document.info.ext.value = "E";
    // alert("here");
    setTimeout( "refresh()", 3600*1000 );
    // setTimeout( "refresh()", 10*1000 );
}

function refresh()
{
    setTimeout( "LogOut()", 300*1000 );
    // setTimeout( "LogOut()", 5*1000 );
    // makeWin('https://www.mysite.com/timeout.php');
    appear();
    document.info.ext.value = "";
}


function LogOut(){
       if (document.info.ext.value == "") {
            document.info.action = "https://www.mysite.com/cgi-bin/you/logout.cgi?username=johnson&fn_which=1";
            document.info.method = "POST";
            document.info.submit();
             }
}


function dis(){
       document.getElementById('logout_warning').style.visibility = "hidden";
            // document.getElementById("tft_swapper").innerHTML="<input type=\"hidden\" name=\"pass\" id=\"tft_pass_box\">";
            doLoad();
            // document.getElementById("tft_pass_box").focus();
}

function appear(){
       document.getElementById('logout_warning').style.visibility = "visible";
            // document.getElementById("tft_swapper").innerHTML="<input type=\"button\" name=\"pass\" id=\"tft_pass_box\" class=\"btn\" value=\"Click to Extend Time\" onClick=\"dis(\'tft_swapper\');\">" ;

}

</script>

</head>
<body bgcolor="#E9E9E9" onload="doLoad(); FindCookie();">

<script language="JavaScript"  type="text/javascript">
var errfound=false;
function DeleteFile(){
      errfound = false;
      Demo();
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "D";
            document.info.method = "POST";
            document.info.submit();
      }
}

function Back(){
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.method = "POST";
            document.info.submit();
}


function Addfile(){
      var fileField = document.info.FILE1.value;
      var someField = document.info.FILE1;
      errfound = false;
     
      // if (!ValidLength(fileField,5)) {
      //      alert("You didn't enter a file or valid path for Upload.");
      //      someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
      //      errfound=true;
      //      }
      var re = /.jpg|.jpeg|.gif/ig;
      if (!re.test(fileField) || !ValidLength(fileField,5)) {
          alert("Only gif, jpg and jpeg files can be uploaded");
          someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
          errfound=true;
          }
         
       re = /:/;
       if (!re.test(fileField)) {
            alert("Please enter a valid path on your local computer system.");
            someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" >';
            errfound=true;
            }
         
      Demo();
      if (errfound==false) {
            document.info.action = "https://www.mysite.com/cgi-bin/you/manageFiles.cgi";
            document.info.finder.value = "A";
            document.info.method = "POST";
            // document.info.enctype = "multipart/form-data";
            document.info.submit();
      }
}

function Demo() {

}




function Login(){
      document.info.action = "https://www.mysite.com/cgi-bin/you/login.cgi";
      document.info.method = "POST";
      document.info.submit();
}

function AccCenter(){
      document.info.action = "https://www.mysite.com/cgi-bin/you/accCenter.cgi";
      document.info.method = "POST";
      document.info.submit();
}

function Contact(){
      document.info.action = "https://www.mysite.com/cgi-bin/you/memContact.cgi";
      document.info.method = "POST";
      document.info.submit();
}

function Manage(x){
      document.info.fn_category.value = x;
      document.info.fn_edit.value = "Listing";
      document.info.action = "https://www.mysite.com/cgi-bin/you/memberEntries.cgi";
      document.info.method = "POST";
      document.info.submit();
}

function ViewPlan(){
            document.info.action = "https://www.mysite.com/cgi-bin/you/vplan.cgi";
            document.info.method = "POST";
            document.info.submit();
}

function makeWin(url) {
            agent = navigator.userAgent;
            windowName = "Sitelet";
            params  = "";
            params += "toolbar=1,";
            params += "location=0,";
            params += "directories=0,";
            params += "status=0,";
            params += "menubar=1,";
            params += "scrollbars=1,";
            params += "resizable=1,";
            params += "width=820,";
            params += "height=600";
            win = window.open(url, windowName , params);
            if (agent.indexOf("Mozilla/2") != -1 && agent.indexOf("Win") == -1) {
                win = window.open(url, windowName , params);
            }
            if (!win.opener) {

                win.opener = window;
            }
}



function ValidLength(item, len) {
   return (item.length >= len);
}

function error(elem, text) {
   if (errfound) return;
   window.alert(text);
     if ( elem.type == "text" )
            elem.select();
   elem.focus();
   errfound = true;
}

</script>

<table width="800" border="0" align="center">
  <tr>
    <td width="198">
          <a href="javascript:Login()"><img src="https://www.mysite.com/images/logo_beta1.jpg" width="197" height="125" border="0" class="shiftdown"></a> </td>
    <td width="592" valign="top" align="right"><div style="text-align: center; background:#FFFFFF; padding-right: 10px; font-size: 75%; width: 550px;"> Welcome, <strong>Johnson Harris | <a href="javascript:ViewPlan();">Your Summary</a> |  <a href="javascript:makeWin('http://www.mysite.com/help/index')">Site Help</a> | <a href="javascript:Contact()">Contact Us</a> | <a href="javascript:LogMeOut();">Log Out</a></strong></div>
   <div class="dialogd" style="width: 560px;">
 <div class="ft">
   <div class="c">
   </div>
  </div>
 </div>      
      <div id="logout_warning">
Your account has been inactive for 60 minutes and you will now be logged out. To extend your session, click below:<br>
<input type="button" name="pass"  class="extend" value="Click to Extend Time" onClick="dis();">
</div>
</td>
  </tr>
</table>

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td>
 
  <div id="header1">
<ul>
      <li id="white12"><a href="javascript:Manage('Gifts')">Gifts &nbsp;</a></li>
          <li id="white6"><a href="javascript:Manage('Insurance')">Insurance &nbsp;</a></li>
      <li id="white2"><a href="javascript:Manage('Introduction')">Introduction &nbsp;</a></li>
      <li id="white7"><a href="javascript:Manage('Letters')">Letters &nbsp;</a></li>
      <li id="white13"><a href="javascript:Manage('Messages')">Messages &nbsp;</a></li>
            <li id="white9"><a href="javascript:Manage('Passwords')">Passwords</a> </li>
      <li id="white10"><a href="javascript:Manage('Personal')">Personal</a> </li>
</ul>
</div>
</td>
</tr>
<tr>
<td>
<div id="header1">
<ul>
      <li id="white1"><a href="javascript:Login()">My Home</a></li>
      <li id="white14"><a href="javascript:AccCenter()">Account Center</a></li>
      <li id="white11"><a href="javascript:Manage('Directives')">Directives</a></li>  
      <li id="white3"><a href="javascript:Manage('Emails')">Emails</a></li>
      <li id="white4"><a href="javascript:Manage('Estate')">Estate</a></li>
      <li id="white8"><a href="javascript:Manage('Final Wishes')">Final Wishes </a></li>
      <li id="white5"><a href="javascript:Manage('Finance')">Finance</a></li>
      
</ul>
</div>
</td>
</tr>
</table>

<table width="810" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
    <div class="dialogb">
       <div class="hd">
          <div class="c">
          </div>
       </div>
    </div>
    </td>
 </tr>
</table>

<table align="center" width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
 
<form name="info" method="post" enctype="multipart/form-data">

<input type="hidden" name="ext">


<input type="hidden" name="finder" value="">
<input type="hidden" name="fn_category" value="">
<input type="hidden" name="fn_edit" value="">

<tr><td colspan="2" align="left"><span class="header_text">Manage Images<br></span></td></tr>
<tr><td colspan="5">You can upload files from your computer and store them on our server. These image files are then accessible when
you make entries to your plan. We only accept <b>.gif, .jpeg and .jpg</b> images at this time. There is a 300kb size restriction.<br><br></td></tr>
<tr><td colspan="5">

<span><INPUT TYPE="file" NAME="FILE1" class="btn" size="50" ></span>
<input type="button" value="Upload Picture" class="btn" onClick="Addfile();">
<br><br>
 </td></tr>
<tr>

                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/10-22-06_1103.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_10-22-06_1103.jpg"  border="0"></a>
                      <br>10-22-06_1103.jpg<br>30.5<b>kb</b>
                      <input type="checkbox" name="line1" class="btn" value="thumb_10-22-06_1103.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/beach.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_beach.jpg"  border="0"></a>
                      <br>beach.jpg<br>62.3<b>kb</b>
                      <input type="checkbox" name="line2" class="btn" value="thumb_beach.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/cf.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_cf.jpg"  border="0"></a>
                      <br>cf.jpg<br>38.8<b>kb</b>
                      <input type="checkbox" name="line3" class="btn" value="thumb_cf.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/cv_card.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_cv_card.jpg"  border="0"></a>
                      <br>cv_card.jpg<br>37.9<b>kb</b>
                      <input type="checkbox" name="line4" class="btn" value="thumb_cv_card.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/drywall.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_drywall.jpg"  border="0"></a>
                      <br>drywall.jpg<br>17.1<b>kb</b>
                      <input type="checkbox" name="line5" class="btn" value="thumb_drywall.jpg"></td>
                      </tr><tr>
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/faen.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_faen.jpg"  border="0"></a>
                      <br>faen.jpg<br>42.5<b>kb</b>
                      <input type="checkbox" name="line1" class="btn" value="thumb_faen.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/girlsinaudi-small.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_girlsinaudi-small.jpg"  border="0"></a>
                      <br>girlsinaudi-small.jpg<br>107.2<b>kb</b>
                      <input type="checkbox" name="line2" class="btn" value="thumb_girlsinaudi-small.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/hair.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_hair.jpg"  border="0"></a>
                      <br>hair.jpg<br>46.7<b>kb</b>
                      <input type="checkbox" name="line3" class="btn" value="thumb_hair.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/liquitane.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_liquitane.jpg"  border="0"></a>
                      <br>liquitane.jpg<br>46.5<b>kb</b>
                      <input type="checkbox" name="line4" class="btn" value="thumb_liquitane.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/mem.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_mem.jpg"  border="0"></a>
                      <br>mem.jpg<br>153.3<b>kb</b>
                      <input type="checkbox" name="line5" class="btn" value="thumb_mem.jpg"></td>
                      </tr><tr>
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/tmpphpw94oka.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_tmpphpw94oka.jpg"  border="0"></a>
                      <br>tmpphpw94oka.jpg<br>39.3<b>kb</b>
                      <input type="checkbox" name="line1" class="btn" value="thumb_tmpphpw94oka.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/up_cell_left.jpg')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_up_cell_left.jpg"  border="0"></a>
                      <br>up_cell_left.jpg<br>0.3<b>kb</b>
                      <input type="checkbox" name="line2" class="btn" value="thumb_up_cell_left.jpg"></td>
                      
                      <td><a href=javascript:makeWin('https://www.mysite.com/files/johnsonharris/verification_seal.gif')>
                      <img src="https://www.mysite.com/files/johnsonharris/thumb_verification_seal.gif"  border="0"></a>
                      <br>verification_seal.gif<br>2.9<b>kb</b>
                      <input type="checkbox" name="line3" class="btn" value="thumb_verification_seal.gif"></td>
                      <td>&nbsp</td><td>&nbsp</td></tr>

<tr><td colspan="5">

      <br><input type="button" value="Delete Checked Files" class="btn" onClick="DeleteFile();">&nbsp;
      <input type="button" value="Done" class="btn" OnClick="AccCenter();">&nbsp;&nbsp;Space Used: <b>669.3<b>kb</b></b> (Includes thumbnails)
      
      

</td></tr>
</form>
</table>
<table class="smallnavlinks" width="810" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
   <td>
    <div class="dialogb">
    <div class="ft">
     <div class="c"></div>
    </div>
      </div>
  </td>
 </tr>
 <tr>
  <td class="footer_text">
  <div style="float: left; margin: 10px 0px 0 10px;">
         <a href="http://hackerstopper.com/verified.php?name=mysite" target="_blank"><img src="https://www.mysite.com/images/verified.gif" alt="HackerStopper has verified that mysite is a completely secure website." width="100" height="65" border="0" /></a><br />
         <span class="hacker_stopper">Secured-Mar 23, 2007</span> </div>
 
  <p><a href="javascript:Contact()"><br />
    Contact Us</a> | <a href="javascript:makeWin('https://www.mysite.com/cgi-bin/you/memTellFriend.cgi')">Tell a Friend</a></p>
  <p> &#169;2007 mysite.com </p>
  </td>
 </tr>
</table>
</body></html>


0
 

Author Comment

by:nhtahoe
ID: 18783359
Okay, this works without error in both IE and FF.
Oh the hours spent on making it work for both!

So done. If you have any more suggestions, let me know.

            if (browserName=="Netscape") {
                  document.getElementById("FILE1").innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" id="FILE1" >'; }
            else {
                  someField.parentNode.innerHTML ='<INPUT TYPE="file" NAME="FILE1" class="btn" size="50" id="FILE1">'; }
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 18783601
In Netscape you get problems because the <form> tag is embedded betwean <table> and <tr> tags.
Put the <form> and <input> tags either before <table> or inside a <td> section.
In Netscape are sections nested, in IE is that problem ignored.

0
 

Author Comment

by:nhtahoe
ID: 18783624
If I do that, I get a funny space in IE.
Anyway, any other way to solve it? Otherwise, I'll close this out.
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 250 total points
ID: 18784719
<form style="display:inline"....>
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now