cooper549 Posted May 7, 2013 Posted May 7, 2013 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 <% function encodeHTML(sHTML) sHTML=replace(sHTML,"&","&") sHTML=replace(sHTML,"<","<") sHTML=replace(sHTML,">",">") encodeHTML=sHTML end function Response.Write encodeHTML(RS("sTHREEexperience")) %> <br /> var oEdit1 = new InnovaEditor("oEdit1");<br /> oEdit1.cmdAssetManager = "modalDialogShow('../assetmanager/assetmanager.asp',640,445);";<br /> oEdit1.mode = "XHTMLBody";<br /> oEdit1.width = "100%";<br /> oEdit1.height = "450px";<br /> oEdit1.css = "admin.css";<br /> oEdit1.useDIV = "false";<br /> oEdit1.useBR = "false";<br /> <br /> <br /> oEdit1.features = [<br /> <br /> <br /> "Cut", "Copy", "Paste", "PasteWord", "PasteText", "|",<br /> "Undo", "Redo", "|",<br /> "RemoveFormat", "XHTMLSource", "BRK",<br /> <br /> <br /> "StyleAndFormatting", "TextFormatting", "ListFormatting", "BoxFormatting",<br /> "ParagraphFormatting", "CssText", "Styles", "|",<br /> "Paragraph", "FontName", "FontSize", "|",<br /> "Bold", "Italic", "Underline", "Strikethrough", "|",<br /> "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "|",<br /> "Numbering", "Bullets", "|", "Indent", "Outdent"<br /> <br /> <br /> ];<br /> <br /> <br /> oEdit1.REPLACE("experience");<br />
Steve21 Posted May 7, 2013 Posted May 7, 2013 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. If experience <> "" Then oEdit1.REPLACE("experience"); end if Steve Steve
cooper549 Posted May 7, 2013 Author Posted May 7, 2013 that's my fault sorry, the data base connection stuff is just above and i didn't copy it in, however here you go. 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
cooper549 Posted May 7, 2013 Author Posted May 7, 2013 (edited) 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' Edited May 7, 2013 by cooper549
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now