Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access Denied

Posted on 2011-09-30
22
412 Views
Last Modified: 2012-06-21
Hi,

Hi,

I want to allow the user to click to browse to a document and then store the URL.  The attached code works in Firefox but not IE.  Using IE, I get the above error on document.frmUpload.submit(); but if I click three times it works!  Baffled as to why it works on the third click.  

I've attached code.

Any help / suggestions would be greatly appreciated.

<%@language=vbscript%><!--#include file="Resources/Adovbs.inc"--><%'Standard%>

<!--#include file="Resources/Views_Audit.asp"-->

<%
	'Close off all objects...
		Set objRS = Nothing : Set objCombo = Nothing : objConn.Close : Set objConn = Nothing
%>

<html>
	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    	<link href="Resources/Style.css" type="text/css" rel="stylesheet">
		<script src="Resources/Java.js" language="JavaScript" type="text/javascript"></script>
    </head>
	
    <body class="Main">
	
    	<div class="PageHeader" style="position:absolute; top:0px; left:0px; width:100%;">
            <img src="images/top-left.gif" style="position:absolute; top:0px; left:0px;">					
            <img src="images/top-right.gif" style="position:absolute; top:0px; right:0px;">
            <img src="images/bot-right.gif" style="position:absolute; bottom:0px; right:0px;">
            <img src="images/bot-left.gif" style="position:absolute; bottom:0px; left:0px;">

			&nbsp;FileStore:<font color="<%=appFontContrast%>"> to store up to 20 file locations please complete the following:</font>
		</div>
	
    	<div style="position:absolute; top:25px; left:0px; width:100%; height:30px;" align="right">
        
            <img
                id="btnClear"
                src="Images/btnClear.gif"
                style="cursor:pointer;"
                alt="Clear all entries..."
                title="Clear all entries..."
                onMouseOver="MM_swapImage('btnClear','','Images/btnClear_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('FileStore_Upload_URL.asp?<%=Request.QueryString%>');">
        
            <img
                id="btnBack"
                src="Images/btnBack.gif"
                style="cursor:pointer;"
                alt="Back to FileStore list..."
                title="Back to FileStore list..."
                onMouseOver="MM_swapImage('btnBack','','Images/btnBack_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('<%=Request.QueryString("SourcePage")%>?SourceTable=<%=Request.QueryString("SourceTable")%>&SubID=<%=Request.QueryString("SubID")%>');">
                
            <img
                id="btnSend"
                src="Images/btnSend.gif"
                style="cursor:pointer;"
                alt="Upload your file..."
                title="Upload your file..."
                onMouseOver="MM_swapImage('btnSend','','Images/btnSend_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="ValidateForm();">

		</div>
	
    	<div style="position:absolute; top:48px; left:0px; width:100%;">
			
            <table border="0" cellpadding="0" cellspacing="2" style="width:100%;">
			
            	<form id="frmUpload" name="frmUpload" method="post" action="Filestore_SaveNew_URL.asp">
					<input type="hidden" id="SourcePage" name="SourcePage" value="<%=Request.QueryString("SourcePage")%>">
					<input type="hidden" id="SubID" name="SubID" value="<%=Request.QueryString("SubID")%>">
					<%'Pass table name as session variable to use for file path because uploaded file has to be saved before other varaiables are parsed...
					Session("FileStore") = Request.QueryString("SourceTable")
					nTop = 5
					For n = 1 To 10%>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name <%=n%></td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_<%=n%>" name="File_<%=n%>"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('<%=n%>')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:<%=nTop%>px; right:7px;"
                                    id="File_<%=n%>_img" name="File_<%=n%>_img"
                                    onMouseDown="changer('File_<%=n%>_img',7);"
                                    onMouseUp="changer('File_<%=n%>_img',6);"
                                    onClick="document.getElementById('File_<%=n%>').click();">
                                    
                                <input type="text" class="Input" name="File<%=n%>" id="File<%=n%>"
                                    style="width:90%;position:absolute; top:<%=nTop%>px; left:85px;" readonly>
                                    
                                <%nTop = nTop + 49%>
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type <%=n%></td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc<%=n%>_img" name="Desc<%=n%>_img"
                                    onMouseDown="changer('Desc<%=n%>_img',7);"
                                    onMouseUp="changer('Desc<%=n%>_img',6);"
                                    onClick="Search('Desc<%=n%>', 'FileStore', '<%=strSearchField%>', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc<%=n%>" id="Desc<%=n%>"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					<%Next%>
				</form>
                
			</table>
            
		</div>
        
	</body>
    
</html>

<script language="Javascript" type="text/javascript">
	<!--
	
		function getFile(fieldNo)
			{
				document.getElementById('File' + fieldNo).value = document.getElementById('File_' + fieldNo).value;
			}
			
		//Upload form validation and submission...		
			function ValidateForm()
				{
					var fileSelected = false;
					for (var n = 1; n<=10; n++)
						{
							var strfilename = 'File' + n
							if(document.getElementById(strfilename).value.length > 0)
								{
									fileSelected = true;
								}	
						}
					if (fileSelected == false)
						{
							alert('Please select a file to upload...');
							return false;
						}	

					document.frmUpload.submit();
				}
				
		//Set up field control images...
			if (document.images)
				{
					pics = new Array();
					pics[0] = new Image(); pics[0].src = "Images/Calendar.gif";
					pics[1] = new Image(); pics[1].src = "Images/Calendar_Down.gif";
					pics[2] = new Image(); pics[2].src = "Images/Calendar_X.gif";
					pics[3] = new Image(); pics[3].src = "Images/Calendar_X_Down.gif";
					pics[4] = new Image(); pics[4].src = "Images/Email.gif";
					pics[5] = new Image(); pics[5].src = "Images/Email_Down.gif";
					pics[6] = new Image(); pics[6].src = "Images/Search.gif";
					pics[7] = new Image(); pics[7].src = "Images/Search_Down.gif";
					pics[8] = new Image(); pics[8].src = "Images/Map.gif";
					pics[9] = new Image(); pics[9].src = "Images/Map_Down.gif";
				}
				
		//Set up field control image animations...
			function changer(from,to)
				{
					if (document.images)
						{
							document.images[from].src = pics[to].src;
						}
				}
				
		//Field search...	
			function Search(fieldname, doctype, SearchID, posX, posY)
				{
					var strAttributes = 'help=no, status=no,  location=no , resizable=no, toolbar=no, menubar=no, scrollbars=yes';
					strAttributes += ', width=400, height=600, top=' + (posY - 600) + ', left=' + (posX - 300);
				
					var strURL = doctype + '_FieldSearch.asp?fieldname=' + fieldname + '&doctype=' + doctype + '&<%=strSearchField%>=' + SearchID;
						//pass the field name to the new window so it can be identified on close for updating...
				
					stdwin_win = open(strURL, 'stdwin_win', strAttributes);
					stdwin_win.opener = self;
				}
				
	//-->
</script>

Open in new window

0
Comment
Question by:Tra71
22 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 36890497
I'm wondering why this is in the Java TA..?
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36890503

This does not seem to belong to Java Programming Language
0
 

Author Comment

by:Tra71
ID: 36890512
function getFile(fieldNo)
                  {
                        document.getElementById('File' + fieldNo).value = document.getElementById('File_' + fieldNo).value;
                  }
                  
            //Upload form validation and submission...            
                  function ValidateForm()
                        {
                              var fileSelected = false;
                              for (var n = 1; n<=10; n++)
                                    {
                                          var strfilename = 'File' + n
                                          if(document.getElementById(strfilename).value.length > 0)
                                                {
                                                      fileSelected = true;
                                                }      
                                    }
                              if (fileSelected == false)
                                    {
                                          alert('Please select a file to upload...');
                                          return false;
                                    }      

                              document.frmUpload.submit();
                        }
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 500 total points
ID: 36890519
instead of this   document.frmUpload.submit();

use document.forms[0].submit();
0
 

Author Comment

by:Tra71
ID: 36890537
Thanks, i still go the same message and on the third time, it worked...
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890542
great
0
 

Author Comment

by:Tra71
ID: 36890556
No it's still a problem.  I have to click the save button three times for it to work.  Says Access Denied the other two times...
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890566
can you attach HTML source code?
0
 

Author Comment

by:Tra71
ID: 36890582
Attached is the full code.
<%
	'Injection monitor...
		If Len(Request.ServerVariables("QUERY_STRING")) > 0 Then
		
			Dim strQuery
					
			strQuery = UCase(Request.ServerVariables("QUERY_STRING"))
			strQuery = Replace(URLDecode(strQuery), " ", "")
			
			If InStr(strQuery,"EXEC(") > 0 OR _
				InStr(strQuery,"SELECT") > 0 OR _
				InStr(strQuery,"INSERT") > 0 OR _
				InStr(strQuery,"UPDATE") > 0 OR _
				InStr(strQuery,"DELETE") > 0 OR _
				Len(strQuery) > 500 Then
				Response.Redirect("http://www.google.co.uk")
			End If
			
			Set objConn = Server.CreateObject("ADODB.Connection") : objConn.Open appDBConn
			
			Set objRS = Server.CreateObject("ADODB.Recordset") : Set objRS.ActiveConnection = objConn
			objRS.CursorLocation = adUseServer : objRS.Cursortype = adOpenStatic : objRS.Locktype = adLockOptimistic
			
			strSQL = "INSERT INTO [Injection Log] ([IP]) SELECT '" & Request.ServerVariables("REMOTE_ADDR") & "';"
			objRS.Open strSQL, objConn
						
			Set objRS = Nothing : objConn.Close: Set objConn = Nothing
			
		End If
		
	'Ensure page is not cached on the client...
		Response.Expires = -1
		Response.ExpiresAbsolute = (Now() - 1)
		Response.AddHeader "pragma","no-cache"
		Response.AddHeader "cache-control","private"
		Response.CacheControl = "no-cache"

	'Check for session authentication...
		strPage = Right(Request.ServerVariables("URL"),(Len(Request.ServerVariables("URL")))-InStrRev(Request.ServerVariables("URL"),"/"))
		If Session("ID") = "" Then
			If Not Request.QueryString("PDF") = "True" Then
				Response.Redirect("LogOut.asp?Page=" & Request.ServerVariables("URL"))
			End If
		End If
		
	'Open database connection...
		Set objConn = Server.CreateObject("ADODB.Connection")
		objConn.Open appDBConn

	'Create recordset objects...
		Set objRS = Server.CreateObject("ADODB.Recordset") : Set objRS.ActiveConnection = objConn
		objRS.CursorLocation = adUseServer : objRS.Cursortype = adOpenStatic : objRS.Locktype = adLockOptimistic
		
		Set objCombo = Server.CreateObject("ADODB.Recordset") : Set objCombo.ActiveConnection=objConn
		objCombo.CursorLocation=adUseServer : objCombo.Cursortype=adOpenStatic : objCombo.Locktype=adLockOptimistic
		
	'Log page visit...
		If Not Request.QueryString("PDF") = "True" Then
			strSQL = "INSERT INTO [Session Log] ([Page],[Data],[SubID]) SELECT "
			strSQL = strSQL & "'" & strPage & "', '" & Request.QueryString & "', " & Session("ID") & ";"
			objRS.Open strSQL, objConn
		End If
%>
<%
	'Close off all objects...
		Set objRS = Nothing : Set objCombo = Nothing : objConn.Close : Set objConn = Nothing
%>

<html>
	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    	<link href="Resources/Style.css" type="text/css" rel="stylesheet">
		<script src="Resources/Java.js" language="JavaScript" type="text/javascript"></script>
    </head>
	
    <body class="Main">
	
    	<div class="PageHeader" style="position:absolute; top:0px; left:0px; width:100%;">
            <img src="images/top-left.gif" style="position:absolute; top:0px; left:0px;">					
            <img src="images/top-right.gif" style="position:absolute; top:0px; right:0px;">
            <img src="images/bot-right.gif" style="position:absolute; bottom:0px; right:0px;">
            <img src="images/bot-left.gif" style="position:absolute; bottom:0px; left:0px;">

			&nbsp;FileStore:<font color="<%=appFontContrast%>"> to store up to 20 file locations please complete the following:</font>
		</div>
	
    	<div style="position:absolute; top:25px; left:0px; width:100%; height:30px;" align="right">
        
            <img
                id="btnClear"
                src="Images/btnClear.gif"
                style="cursor:pointer;"
                alt="Clear all entries..."
                title="Clear all entries..."
                onMouseOver="MM_swapImage('btnClear','','Images/btnClear_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('FileStore_Upload_URL.asp?<%=Request.QueryString%>');">
        
            <img
                id="btnBack"
                src="Images/btnBack.gif"
                style="cursor:pointer;"
                alt="Back to FileStore list..."
                title="Back to FileStore list..."
                onMouseOver="MM_swapImage('btnBack','','Images/btnBack_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('<%=Request.QueryString("SourcePage")%>?SourceTable=<%=Request.QueryString("SourceTable")%>&SubID=<%=Request.QueryString("SubID")%>');">
                
            <img
                id="btnSend"
                src="Images/btnSend.gif"
                style="cursor:pointer;"
                alt="Upload your file..."
                title="Upload your file..."
                onMouseOver="MM_swapImage('btnSend','','Images/btnSend_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="ValidateForm();">

		</div>
	
    	<div style="position:absolute; top:48px; left:0px; width:100%;">
			
            <table border="0" cellpadding="0" cellspacing="2" style="width:100%;">
			
            	<form id="frmUpload" name="frmUpload" method="post" action="Filestore_SaveNew_URL.asp">
					<input type="hidden" id="SourcePage" name="SourcePage" value="<%=Request.QueryString("SourcePage")%>">
					<input type="hidden" id="SubID" name="SubID" value="<%=Request.QueryString("SubID")%>">
					<%'Pass table name as session variable to use for file path because uploaded file has to be saved before other varaiables are parsed...
					Session("FileStore") = Request.QueryString("SourceTable")
					nTop = 5
					For n = 1 To 10%>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name <%=n%></td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_<%=n%>" name="File_<%=n%>"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('<%=n%>')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:<%=nTop%>px; right:7px;"
                                    id="File_<%=n%>_img" name="File_<%=n%>_img"
                                    onMouseDown="changer('File_<%=n%>_img',7);"
                                    onMouseUp="changer('File_<%=n%>_img',6);"
                                    onClick="document.getElementById('File_<%=n%>').click();">
                                    
                                <input type="text" class="Input" name="File<%=n%>" id="File<%=n%>"
                                    style="width:90%;position:absolute; top:<%=nTop%>px; left:85px;" readonly>
                                    
                                <%nTop = nTop + 49%>
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type <%=n%></td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc<%=n%>_img" name="Desc<%=n%>_img"
                                    onMouseDown="changer('Desc<%=n%>_img',7);"
                                    onMouseUp="changer('Desc<%=n%>_img',6);"
                                    onClick="Search('Desc<%=n%>', 'FileStore', '<%=strSearchField%>', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc<%=n%>" id="Desc<%=n%>"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					<%Next%>
				</form>
                
			</table>
            
		</div>
        
	</body>
    
</html>

<script language="Javascript" type="text/javascript">
	<!--
	
		function getFile(fieldNo)
			{
				document.getElementById('File' + fieldNo).value = document.getElementById('File_' + fieldNo).value;
			}
			
		//Upload form validation and submission...		
			function ValidateForm()
				{
					var fileSelected = false;
					for (var n = 1; n<=10; n++)
						{
							var strfilename = 'File' + n
							if(document.getElementById(strfilename).value.length > 0)
								{
									fileSelected = true;
								}	
						}
					if (fileSelected == false)
						{
							alert('Please select a file to upload...');
							return false;
						}	

					document.forms[0].submit();
				}
				
		//Set up field control images...
			if (document.images)
				{
					pics = new Array();
					pics[0] = new Image(); pics[0].src = "Images/Calendar.gif";
					pics[1] = new Image(); pics[1].src = "Images/Calendar_Down.gif";
					pics[2] = new Image(); pics[2].src = "Images/Calendar_X.gif";
					pics[3] = new Image(); pics[3].src = "Images/Calendar_X_Down.gif";
					pics[4] = new Image(); pics[4].src = "Images/Email.gif";
					pics[5] = new Image(); pics[5].src = "Images/Email_Down.gif";
					pics[6] = new Image(); pics[6].src = "Images/Search.gif";
					pics[7] = new Image(); pics[7].src = "Images/Search_Down.gif";
					pics[8] = new Image(); pics[8].src = "Images/Map.gif";
					pics[9] = new Image(); pics[9].src = "Images/Map_Down.gif";
				}
				
		//Set up field control image animations...
			function changer(from,to)
				{
					if (document.images)
						{
							document.images[from].src = pics[to].src;
						}
				}
				
		//Field search...	
			function Search(fieldname, doctype, SearchID, posX, posY)
				{
					var strAttributes = 'help=no, status=no,  location=no , resizable=no, toolbar=no, menubar=no, scrollbars=yes';
					strAttributes += ', width=400, height=600, top=' + (posY - 600) + ', left=' + (posX - 300);
				
					var strURL = doctype + '_FieldSearch.asp?fieldname=' + fieldname + '&doctype=' + doctype + '&<%=strSearchField%>=' + SearchID;
						//pass the field name to the new window so it can be identified on close for updating...
				
					stdwin_win = open(strURL, 'stdwin_win', strAttributes);
					stdwin_win.opener = self;
				}
				
	//-->
</script>

Open in new window

0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890592
i want HTML code NOT ASP code .once page is displayed do right click and take the HTML code.
0
 

Author Comment

by:Tra71
ID: 36890599
Ah, sorry :)


<html>
	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    	<link href="Resources/Style.css" type="text/css" rel="stylesheet">
		<script src="Resources/Java.js" language="JavaScript" type="text/javascript"></script>
    </head>
	
    <body class="Main">
	
    	<div class="PageHeader" style="position:absolute; top:0px; left:0px; width:100%;">
            <img src="images/top-left.gif" style="position:absolute; top:0px; left:0px;">					
            <img src="images/top-right.gif" style="position:absolute; top:0px; right:0px;">
            <img src="images/bot-right.gif" style="position:absolute; bottom:0px; right:0px;">
            <img src="images/bot-left.gif" style="position:absolute; bottom:0px; left:0px;">

			&nbsp;FileStore:<font color="#bc90be"> to store up to 20 file locations please complete the following:</font>
		</div>
	
    	<div style="position:absolute; top:25px; left:0px; width:100%; height:30px;" align="right">
        
            <img
                id="btnClear"
                src="Images/btnClear.gif"
                style="cursor:pointer;"
                alt="Clear all entries..."
                title="Clear all entries..."
                onMouseOver="MM_swapImage('btnClear','','Images/btnClear_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('FileStore_Upload_URL.asp?SourceTable=Contract%20FileStore&SubID=503&SourcePage=ContractsFileStore_Sub.asp');">
        
            <img
                id="btnBack"
                src="Images/btnBack.gif"
                style="cursor:pointer;"
                alt="Back to FileStore list..."
                title="Back to FileStore list..."
                onMouseOver="MM_swapImage('btnBack','','Images/btnBack_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="location.replace('ContractsFileStore_Sub.asp?SourceTable=Contract FileStore&SubID=503');">
                
            <img
                id="btnSend"
                src="Images/btnSend.gif"
                style="cursor:pointer;"
                alt="Upload your file..."
                title="Upload your file..."
                onMouseOver="MM_swapImage('btnSend','','Images/btnSend_O.gif',1)"
                onMouseOut="MM_swapImgRestore()"
                onClick="ValidateForm();">

		</div>
	
    	<div style="position:absolute; top:48px; left:0px; width:100%;">
			
            <table border="0" cellpadding="0" cellspacing="2" style="width:100%;">
			
            	<form id="frmUpload" name="frmUpload" method="post" action="Filestore_SaveNew_URL.asp">
					<input type="hidden" id="SourcePage" name="SourcePage" value="ContractsFileStore_Sub.asp">
					<input type="hidden" id="SubID" name="SubID" value="503">
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 1</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_1" name="File_1"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('1')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:5px; right:7px;"
                                    id="File_1_img" name="File_1_img"
                                    onMouseDown="changer('File_1_img',7);"
                                    onMouseUp="changer('File_1_img',6);"
                                    onClick="document.getElementById('File_1').click();">
                                    
                                <input type="text" class="Input" name="File1" id="File1"
                                    style="width:90%;position:absolute; top:5px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 1</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc1_img" name="Desc1_img"
                                    onMouseDown="changer('Desc1_img',7);"
                                    onMouseUp="changer('Desc1_img',6);"
                                    onClick="Search('Desc1', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc1" id="Desc1"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 2</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_2" name="File_2"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('2')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:54px; right:7px;"
                                    id="File_2_img" name="File_2_img"
                                    onMouseDown="changer('File_2_img',7);"
                                    onMouseUp="changer('File_2_img',6);"
                                    onClick="document.getElementById('File_2').click();">
                                    
                                <input type="text" class="Input" name="File2" id="File2"
                                    style="width:90%;position:absolute; top:54px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 2</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc2_img" name="Desc2_img"
                                    onMouseDown="changer('Desc2_img',7);"
                                    onMouseUp="changer('Desc2_img',6);"
                                    onClick="Search('Desc2', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc2" id="Desc2"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 3</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_3" name="File_3"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('3')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:103px; right:7px;"
                                    id="File_3_img" name="File_3_img"
                                    onMouseDown="changer('File_3_img',7);"
                                    onMouseUp="changer('File_3_img',6);"
                                    onClick="document.getElementById('File_3').click();">
                                    
                                <input type="text" class="Input" name="File3" id="File3"
                                    style="width:90%;position:absolute; top:103px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 3</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc3_img" name="Desc3_img"
                                    onMouseDown="changer('Desc3_img',7);"
                                    onMouseUp="changer('Desc3_img',6);"
                                    onClick="Search('Desc3', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc3" id="Desc3"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 4</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_4" name="File_4"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('4')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:152px; right:7px;"
                                    id="File_4_img" name="File_4_img"
                                    onMouseDown="changer('File_4_img',7);"
                                    onMouseUp="changer('File_4_img',6);"
                                    onClick="document.getElementById('File_4').click();">
                                    
                                <input type="text" class="Input" name="File4" id="File4"
                                    style="width:90%;position:absolute; top:152px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 4</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc4_img" name="Desc4_img"
                                    onMouseDown="changer('Desc4_img',7);"
                                    onMouseUp="changer('Desc4_img',6);"
                                    onClick="Search('Desc4', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc4" id="Desc4"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 5</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_5" name="File_5"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('5')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:201px; right:7px;"
                                    id="File_5_img" name="File_5_img"
                                    onMouseDown="changer('File_5_img',7);"
                                    onMouseUp="changer('File_5_img',6);"
                                    onClick="document.getElementById('File_5').click();">
                                    
                                <input type="text" class="Input" name="File5" id="File5"
                                    style="width:90%;position:absolute; top:201px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 5</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc5_img" name="Desc5_img"
                                    onMouseDown="changer('Desc5_img',7);"
                                    onMouseUp="changer('Desc5_img',6);"
                                    onClick="Search('Desc5', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc5" id="Desc5"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 6</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_6" name="File_6"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('6')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:250px; right:7px;"
                                    id="File_6_img" name="File_6_img"
                                    onMouseDown="changer('File_6_img',7);"
                                    onMouseUp="changer('File_6_img',6);"
                                    onClick="document.getElementById('File_6').click();">
                                    
                                <input type="text" class="Input" name="File6" id="File6"
                                    style="width:90%;position:absolute; top:250px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 6</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc6_img" name="Desc6_img"
                                    onMouseDown="changer('Desc6_img',7);"
                                    onMouseUp="changer('Desc6_img',6);"
                                    onClick="Search('Desc6', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc6" id="Desc6"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 7</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_7" name="File_7"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('7')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:299px; right:7px;"
                                    id="File_7_img" name="File_7_img"
                                    onMouseDown="changer('File_7_img',7);"
                                    onMouseUp="changer('File_7_img',6);"
                                    onClick="document.getElementById('File_7').click();">
                                    
                                <input type="text" class="Input" name="File7" id="File7"
                                    style="width:90%;position:absolute; top:299px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 7</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc7_img" name="Desc7_img"
                                    onMouseDown="changer('Desc7_img',7);"
                                    onMouseUp="changer('Desc7_img',6);"
                                    onClick="Search('Desc7', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc7" id="Desc7"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 8</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_8" name="File_8"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('8')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:348px; right:7px;"
                                    id="File_8_img" name="File_8_img"
                                    onMouseDown="changer('File_8_img',7);"
                                    onMouseUp="changer('File_8_img',6);"
                                    onClick="document.getElementById('File_8').click();">
                                    
                                <input type="text" class="Input" name="File8" id="File8"
                                    style="width:90%;position:absolute; top:348px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 8</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc8_img" name="Desc8_img"
                                    onMouseDown="changer('Desc8_img',7);"
                                    onMouseUp="changer('Desc8_img',6);"
                                    onClick="Search('Desc8', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc8" id="Desc8"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 9</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_9" name="File_9"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('9')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:397px; right:7px;"
                                    id="File_9_img" name="File_9_img"
                                    onMouseDown="changer('File_9_img',7);"
                                    onMouseUp="changer('File_9_img',6);"
                                    onClick="document.getElementById('File_9').click();">
                                    
                                <input type="text" class="Input" name="File9" id="File9"
                                    style="width:90%;position:absolute; top:397px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 9</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc9_img" name="Desc9_img"
                                    onMouseDown="changer('Desc9_img',7);"
                                    onMouseUp="changer('Desc9_img',6);"
                                    onClick="Search('Desc9', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc9" id="Desc9"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name 10</td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_10" name="File_10"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:hidden;"
                                    onChange="getFile('10')">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; position:absolute; top:446px; right:7px;"
                                    id="File_10_img" name="File_10_img"
                                    onMouseDown="changer('File_10_img',7);"
                                    onMouseUp="changer('File_10_img',6);"
                                    onClick="document.getElementById('File_10').click();">
                                    
                                <input type="text" class="Input" name="File10" id="File10"
                                    style="width:90%;position:absolute; top:446px; left:85px;" readonly>
                                    
                                
                                    
							</td>
						</tr>
						<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;Doc Type 10</td>
							<td class="Table_Row" style="width:80%;">

                                <img align="right" src="Images/Search.gif" border="0"
                                	style="cursor:pointer; "
                                    id="Desc10_img" name="Desc10_img"
                                    onMouseDown="changer('Desc10_img',7);"
                                    onMouseUp="changer('Desc10_img',6);"
                                    onClick="Search('Desc10', 'FileStore', '', event.screenX, event.screenY);">
                                    
                                <input type="text" class="Input" name="Desc10" id="Desc10"
                                    style="width:98%;">
                                    
							</td>
						</tr>
                        <tr><td style="height:1px;"></td></tr>
					
				</form>
                
			</table>
            
		</div>
        
	</body>
    
</html>

<script language="Javascript" type="text/javascript">
	<!--
	
		function getFile(fieldNo)
			{
				document.getElementById('File' + fieldNo).value = document.getElementById('File_' + fieldNo).value;
			}
			
		//Upload form validation and submission...		
			function ValidateForm()
				{
					var fileSelected = false;
					for (var n = 1; n<=10; n++)
						{
							var strfilename = 'File' + n
							if(document.getElementById(strfilename).value.length > 0)
								{
									fileSelected = true;
								}	
						}
					if (fileSelected == false)
						{
							alert('Please select a file to upload...');
							return false;
						}	

					document.forms[0].submit();
				}
				
		//Set up field control images...
			if (document.images)
				{
					pics = new Array();
					pics[0] = new Image(); pics[0].src = "Images/Calendar.gif";
					pics[1] = new Image(); pics[1].src = "Images/Calendar_Down.gif";
					pics[2] = new Image(); pics[2].src = "Images/Calendar_X.gif";
					pics[3] = new Image(); pics[3].src = "Images/Calendar_X_Down.gif";
					pics[4] = new Image(); pics[4].src = "Images/Email.gif";
					pics[5] = new Image(); pics[5].src = "Images/Email_Down.gif";
					pics[6] = new Image(); pics[6].src = "Images/Search.gif";
					pics[7] = new Image(); pics[7].src = "Images/Search_Down.gif";
					pics[8] = new Image(); pics[8].src = "Images/Map.gif";
					pics[9] = new Image(); pics[9].src = "Images/Map_Down.gif";
				}
				
		//Set up field control image animations...
			function changer(from,to)
				{
					if (document.images)
						{
							document.images[from].src = pics[to].src;
						}
				}
				
		//Field search...	
			function Search(fieldname, doctype, SearchID, posX, posY)
				{
					var strAttributes = 'help=no, status=no,  location=no , resizable=no, toolbar=no, menubar=no, scrollbars=yes';
					strAttributes += ', width=400, height=600, top=' + (posY - 600) + ', left=' + (posX - 300);
				
					var strURL = doctype + '_FieldSearch.asp?fieldname=' + fieldname + '&doctype=' + doctype + '&=' + SearchID;
						//pass the field name to the new window so it can be identified on close for updating...
				
					stdwin_win = open(strURL, 'stdwin_win', strAttributes);
					stdwin_win.opener = self;
				}
				
	//-->
</script>

Open in new window

0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890640
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <script>
  function ValidateForm()
				{
					var fileSelected = false;
					var count =0;
					
					for (var n = 1; n<=5; n++)
						{
							var strfilename = 'File' + n
							if(document.getElementById(strfilename).value.length > 0)
								{
									count++;
								}	
						}
					
					if (count != 5)
						{
							alert('Please select a file to upload...');
							return false;
						}	
						alert(count)
					if(count == 5)
					{
					alert("submit")
					document.forms[0].submit();
					}
				}
  </script>
 </HEAD>

 <BODY>
 <form>
<input type='text' id='File1'> 
<input type='text' id='File2'> 
<input type='text' id='File3'> 
<input type='text' id='File4'> 
<input type='text' id='File5'> 
<input type='button' value='save' onclick='ValidateForm();'> 
</form>
 </BODY>
</HTML>

Open in new window

0
 

Author Comment

by:Tra71
ID: 36890686
Thanks,

I replaced my code with the above.  I had to click to get 5 urls to get to the Submit.  When I click save, it alerts "5" then alerts "Submit".  I still get the Access is Denied message (SCRIPT5: Access is denied.)
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890694
May i know at which line your are getting exception?
0
 

Author Comment

by:Tra71
ID: 36890716
SCRIPT5: Access is denied.
 
FileStore_Upload_URL.asp?SourceTable=Contract FileStore&SubID=503&SourcePage=ContractsFileStore_Sub.asp, line 495 character 6



Capture.PNG
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890735
there is space is coming between Contract and FileStore;i think it should be ContractsFileStore.

FileStore_Upload_URL.asp?SourceTable=Contract%20FileStore&SubID=503&SourcePage=ContractsFileStore_Sub.asp
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890743
FileStore_Upload_URL.asp?SourceTable=ContractFileStore&SubID=503&SourcePage=ContractsFileStore_Sub.asp
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36890747
here also space exists in the url.you must remove these spaces..

ontractsFileStore_Sub.asp?SourceTable=Contract FileStore&SubID=503
0
 

Author Comment

by:Tra71
ID: 36890762
The space is correct, the table is "Contract FileStore".  If I do not use the click(); and manually enter a URL it saves first time, it's only when browsing to get the URL that there is a problem.  
0
 

Assisted Solution

by:Tra71
Tra71 earned 0 total points
ID: 36909357
I removed the text field and made the File field visible.  I had to also amend my IE security settings to allow it - changed "Include local directory path when uploading files to a server" to enable.


<tr>		
							<td class="Table_Head" style="width:20%;">&nbsp;File Name <%=n%></td>
							<td class="Table_Row" style="width:80%;">
                                <input type="file" id="File_<%=n%>" name="File_<%=n%>"
                                    style="position:relative; top:0px; left:0px; width:100%; visibility:visible;" >
                                    
                                <%nTop = nTop + 49%>
                                    
							</td>
						</tr>

Open in new window

0
 

Author Closing Comment

by:Tra71
ID: 36938103
I have made it work, still not sure why I got access denied twice and then the third time it was accepted.  Have allocated you the points for all your time :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

808 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