+ Post New Thread
Results 1 to 4 of 4
Web Development Thread, VBScript runtime error '800a005e' Invalid use of Null: 'Replace' in Coding and Web Development; I'm trying to use innova editor on a web application form for the school i work at, and everything so ...
  1. #1

    Join Date
    Jan 2013
    Posts
    11
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Exclamation VBScript runtime error '800a005e' Invalid use of Null: 'Replace'

    I'm trying to use innova editor on a web application form for the school i work at, and everything so far is good however, for the application form we have a small section where an applicant is required to fill in a a section on experience and achievements, so do to this i thought using text to html would be a good idea as it would include all the line breaks and formatting when i later recall everything from the database. My problem lies when a new application is started and it gets to step 3 which has my textarea (code below) it returns with the error 'Microsoft VBScript runtime error '800a005e' Invalid use of Null: 'Replace'. The text area will work fine when i remove the 'function enclodeHTML' but I'm a little worried that it then wont save my text as it should?

    The field on the MySQL database is using a LONGTEXT just for safe measure, and i would revert back to to a plain textarea but id lose all formatting.

    You can view the form at http://www.moorpark.lancs.sch.uk/supportapp/ but in order to get to step 3 you'll have to fill it out will dummy data to get through the first step (i can clear it all out later)

    and here is a snippet of the code for the textarea with the innova editor.

    If anything else is needed just let me know, I'd really like to solve this today and hopefully the form should be finished.

    Thanks

    Code:
    <textarea name="experience" id="experience">
    
              <%
                function encodeHTML(sHTML)
                    sHTML=replace(sHTML,"&","&amp;")
                    sHTML=replace(sHTML,"<","&lt;")
                    sHTML=replace(sHTML,">","&gt;")
                    encodeHTML=sHTML
                end function
                
                Response.Write encodeHTML(RS("sTHREEexperience"))
                %>
              </textarea> 
              <script>
                              var oEdit1 = new InnovaEditor("oEdit1");
                              oEdit1.cmdAssetManager = "modalDialogShow('../assetmanager/assetmanager.asp',640,445);";
                              oEdit1.mode = "XHTMLBody";
                              oEdit1.width = "100%";
                              oEdit1.height = "450px";
                              oEdit1.css = "admin.css";
                              oEdit1.useDIV = "false";
                              oEdit1.useBR = "false";
    
    
                              oEdit1.features = [
    
    
                "Cut", "Copy", "Paste", "PasteWord", "PasteText", "|",
                "Undo", "Redo", "|",
                "RemoveFormat", "XHTMLSource", "BRK",
    
    
                "StyleAndFormatting", "TextFormatting", "ListFormatting", "BoxFormatting",
                "ParagraphFormatting", "CssText", "Styles", "|",
                "Paragraph", "FontName", "FontSize", "|",
                "Bold", "Italic", "Underline", "Strikethrough", "|",
                "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "|",
                "Numbering", "Bullets", "|", "Indent", "Outdent"
    
    
                ];
    
    
                              oEdit1.REPLACE("experience");
                </script>

  2. #2

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Where are you getting the "experience" data from? Can't see any reference to it, unless I'm being dumb. It's just a normal error that your field is empty, so you could do a check on it first, so it won't run that part if it's empty, but I'm more wondering why it's empty

    e.g.

    Code:
    If experience <> "" Then
    oEdit1.REPLACE("experience");
    end if
    
    Steve
    Steve

  3. #3

    Join Date
    Jan 2013
    Posts
    11
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    that's my fault sorry, the data base connection stuff is just above and i didn't copy it in, however here you go.

    Code:
    	SQL = "SELECT * FROM supportapp5 WHERE UsersRef = '" & UsersRef & "'"	Set RS = Conn.execute(SQL)
    	
    	if RS.EOF then
    		Response.Redirect("default.asp")
    	else
    	
    		UserExists = True
    	
            experience    = RS("sTHREEexperience")
            criminaltick  = RS("sTHREEcriminaltick")
            criminalsign  = RS("sTHREEcriminalsign")
            criminaldate  = RS("sTHREEcriminaldate")
            license       = RS("sTHREElicense")
            canvassing    = RS("sTHREEcanvassing")
            appsign       = RS("sTHREEappsign")
            appdate       = RS("sTHREEappdate")
            
            ref1name      = RS("sTHREEref1name")
            ref1position  = RS("sTHREEref1position")
            ref1address   = RS("sTHREEref1address")
            ref1town      = RS("sTHREEref1town")
            ref1county    = RS("sTHREEref1county")   
            ref1postcode  = RS("sTHREEref1postcode")
            ref1tel       = RS("sTHREEref1tel")
            ref1email     = RS("sTHREEref1email")
    
    
            ref2name      = RS("sTHREEref2name") 
            ref2position  = RS("sTHREEref2position")
            ref2address   = RS("sTHREEref2address")
            ref2town      = RS("sTHREEref2town")
            ref2county    = RS("sTHREEref2county")
            ref2postcode  = RS("sTHREEref2postcode")
            ref2tel       = RS("sTHREEref2tel")
            ref2email     = RS("sTHREEref2email")
    
    
         
    
    
    	end if

  4. #4

    Join Date
    Jan 2013
    Posts
    11
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I've tried using the check, but I'm a little unsure as to where it should actually go as it seems no matter where the code is inserted, it now returns '800a0401Expected end of statement'
    Last edited by cooper549; 7th May 2013 at 08:59 AM.

SHARE:
+ Post New Thread

Similar Threads

  1. Responsible use of USB pen drives?
    By DRogers in forum School ICT Policies
    Replies: 0
    Last Post: 15th February 2006, 09:07 AM
  2. use of pupil images on website
    By adamyoung in forum School ICT Policies
    Replies: 4
    Last Post: 17th October 2005, 11:08 AM
  3. Restricting the use of removeable storage - do you?
    By tarquel in forum School ICT Policies
    Replies: 16
    Last Post: 10th July 2005, 04:13 PM
  4. Use of domain password (& staff AUP, etc.) ;)
    By mark in forum School ICT Policies
    Replies: 22
    Last Post: 29th June 2005, 02:36 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •