close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update Page

Thread began 11/08/2009 12:02 pm by eric284736 | Last modified 11/20/2009 2:24 pm by Eric Mittman | 2370 views | 13 replies |

eric284736

Update Page

Using the HTML editor (Irite) on the update page causes an error if the field is left blank when the initial record is added. I was told to change the database field to input a blank string value.

How do I do that working directly on the SQL panel - see the attachement screen shot.

thx
Eric

Sign in to reply to this post

Eric Mittman

You should be able to put in an empty value here, like a space or "". If you do not need this field in your db to be required you should just update the table to make it not required. Any required field in your db should have a value when a record is inserted. If the value is not needed for every record on insert then it should not be a required value unless you have some alternate content that you would like to add to it.

Sign in to reply to this post

eric284736

Thanks Eric!

Sign in to reply to this post

Eric Mittman

Your welcome, did you add in the blank space or did you just take off the required?

Sign in to reply to this post

eric284736

Hi Eric,

I have tried a couple of things with no success.

In SQL I added the default value as N' '. But the field is set to accept Nulls.

That does not work, so the did N'.' and that does not work.

The error I get on the update page if the field does not contain anything is:
Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'CStr'

/cmi/property-update.asp, line 173

On the insert page, the field is NOT required and it is NOT required in the database because an entry might be added and the additional information field might not be available at the time that uses the IRite editor.

Does that make sense?

thx
Eric

Sign in to reply to this post

Eric Mittman

You should be able to have the field be not required and leave a value blank when inserting. It should just make it an empty value. I did a test with my own pages and can only get this error to occur if I replace the value referenced in the Cstr to be Null. Can you post back with a copy of the page in a zip archive so that I can take a look and try some things out?

Sign in to reply to this post

eric284736

Hi Eric,

Here is a copy of the update page and the insert page.

Thanks,
Eric

Attached Files
page-irite.zip
Sign in to reply to this post

Eric Mittman

The error that you are getting on this update page is referencing line 173 which is where you have the iRite instance. The cStr function is being used around the value from your db like this:

cStr((rsPropertyTable.Fields.Item("Content").Value))



This tells me that the value inside of this cStr is equating to Null. You should try assigning this value to a variable, then do a check for null, if it is then set the value to be "". You can use the IsNull function for asp, it looks like this:

IsNull()

returns true or false based on the value of the parameter

Dim theVal = rsPropertyTable.Fields.Item("Content").Value
If IsNull(theVal) Then
theVal = ""
End If



Then just use this variable for the value of your editor on the page.

Sign in to reply to this post

eric284736

Hi Eric,

Sorry to be dense. Do I alter the code like this:
Original Code:
<%
' WebAssist iRite: Rich Text Editor for Dreamweaver
Dim WARichTextEditor_1 : Set WARichTextEditor_1 = CreateRichTextEditor ("Content", "../WA_iRite/", "800px", "800px", "Custom", "../custom/property-update_Content2.js", "" & cStr((rsPropertyTable.Fields.Item("Content").Value)) & "")
%>

Updated:

<%
Dim theVal = rsPropertyTable.Fields.Item("Content").Value
If IsNull(theVal) Then
theVal = ""


' WebAssist iRite: Rich Text Editor for Dreamweaver
Dim WARichTextEditor_1 : Set WARichTextEditor_1 = CreateRichTextEditor ("Content", "../WA_iRite/", "800px", "800px", "Custom", "../custom/property-update_Content2.js", "" & cStr((rsPropertyTable.Fields.Item("Content").Value)) & "")

End If
%>

Sign in to reply to this post

Eric Mittman

That is mostly how you should update it. You will need to replace the rs code for the instance with the variable and end the if a little earlier like this:

<%
Dim theVal = rsPropertyTable.Fields.Item("Content").Value
If IsNull(theVal) Then
theVal = ""
End If


' WebAssist iRite: Rich Text Editor for Dreamweaver
Dim WARichTextEditor_1 : Set WARichTextEditor_1 = CreateRichTextEditor ("Content", "../WA_iRite/", "800px", "800px", "Custom", "../custom/property-update_Content2.js", "" & cStr((theVal)) & "")

%>
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...