JS DOC table submit problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samaelsh
    New Member
    • Aug 2008
    • 10

    JS DOC table submit problem

    Hi all!
    My problem is this:
    I`ve got an ASP application with an object clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A element (this is DHTML tool for text editing). There is also a form in my application. When I press the "save" button, the app gets the contents of this "clsid:2D36 ..." object, assigns them to one of the form`s fields and submits the form. When submitting simple MS Word DOC text (or any other), everything is fine. But when you try to submit a table from a DOC file, an error occurs: "Access denied" at the line when I submit form: document.forms( 0).submit();
    Here`s some code:

    Code:
    function partifyDocument( varDocument )
    {
    	var strRetVal;
    	
    	strRetVal = varDocument.body.innerHTML;
    
    	return strRetVal;
    
    }
    
    function saveAction()	
    {
    	if (document.forms(0).hlp_type.checked != true)	{
    		try	{
    			document.forms(0).hlp_file.value	=	null;
    			var strContent =	partifyDocument(tbContentElement.DOM)
    			document.forms(0).hlp_text.value	=	strContent;
    			}	catch(exception)	{
    					}	
    				}
    		SaveAndCloseClicked =	true;
    }
    
    function submitAction()	
    {
    	if( document.forms(0).<%=arrLstFlds(1)%>.value == "" ){
     	     alert("Header must not be empty");
    			return false;
    		}
    	document.forms(0)._action.value			=	'edit'
    	saveAction();
            SaveAndCloseOver						=	true;
    	//alert('submiting...');
    	//document.write(tbContentElement.DOM.body.innerHTML);
    	document.forms(0).submit(); ///Error occures here!!!
    }
    Please post your suggextions and advice, I would really appreciate any help!
    P.S.: I`m not actually the author of the app, I`m just fulfilling the bugfixing task
    Last edited by Dormilich; Nov 16 '09, 06:02 PM. Reason: Please use [code] tags when posting code
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Hi I think its may be due to the string capacity u may get problem when u place the table inside the string. It may be a problem I am not sure. I dont have much knowledge in ASP. why cant you try session objects or request objects directly to set the contents.

    Thanks and Regards
    Ramanan Kalirajan

    Comment

    • samaelsh
      New Member
      • Aug 2008
      • 10

      #3
      Thank you for your reply!
      But I can`t use a request or a session object to do this. This is not ASP.NET.
      And in addition there is another asp page with a VB script which processes the form after it has been submitted. So the only way is to submit the form with DOC-text in its input field (attribute action="_HelpAd it.asp").

      Comment

      • RamananKalirajan
        Contributor
        • Mar 2008
        • 608

        #4
        Why cant you try with cookies... Is there any specific requirement that, cookies should not be used?

        Thanks and Regards
        Ramanan Kalirajan

        Comment

        • samaelsh
          New Member
          • Aug 2008
          • 10

          #5
          Well, I thought about the cookies, but this mechanism is used to edit help topics, and their size can grow really fast, and cookies must be rather compact.
          I`ve just found out that it is not specifically DOC problem. The JS submit script fails with error if I try to save any HTML table. Can there are there some specific issues with HTML content of form`s input tags? Or may be I can`t save some HTML tags into javascript string?

          Comment

          • samaelsh
            New Member
            • Aug 2008
            • 10

            #6
            RamananKaliraja n, you were right!!!
            This is because of the length of JS string. MS Explorer has a limitiation on the size of JS string. In Mozilla this limit is greater than in IE, and in Mozilla this error does not occur. But I have to make this work in IE. Can I submit this form partly, for exapmle submit the first half of the string and then the second?

            Comment

            • RamananKalirajan
              Contributor
              • Mar 2008
              • 608

              #7
              Obviously that u can do.. But instead u can send the string content in two parameters.. so that you can send the value in the single submission itself.

              Thanks and Regards
              Ramanan Kalirajan

              Comment

              Working...