Re: value "" cannot convert to number
Thanks very much everyone. I discovered that my routine for assessing the ID value needed an AND instead of an OR, so my empty string was sneaking through the "if" barricade. It seems temporarily subdued, so I'll let sleeping dogs lie. If it poses a problem again, I'll be sure to let you all know. -Sam - Original Message - From: Cameron Childress To: CF-Talk Sent: Monday, December 01, 2003 3:46 PM Subject: RE: value "" cannot convert to number You've not included what you think the value of "ID" is, but if it's "" (an empty string as the error indicates), then val() will return a zero - as it does with any non-numeric value. Also, if it's an empty string, your math operations *should* fail with the error you are giving as it's not a number and math cannot be performed on it! ID should be a number if you are planning on doing any math to it. -Cameron - Cameron Childress Sumo Consulting Inc. --- cell: 678-637-5072 aim: cameroncf email: [EMAIL PROTECTED] -Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Monday, December 01, 2003 12:32 PM To: CF-Talk Subject: value "" cannot convert to number Hi Everyone, Can someone tell be why I get a string convert error. I have tried setting up ID to Val(ID) and even IncrementValue(Val(ID)), but all it ever returns is either 0 or 1, respectively. Apparently ID is not getting converted. "I feel like I'm taking crazy pills!" What is wrong with converting a string to a number, especially when the string is just a concatenation of numbers? Many thanks, Sam The value "" cannot be converted to a number 155 : #ID# 156 : [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
value "" cannot convert to number
Hi Everyone, Can someone tell be why I get a string convert error. I have tried setting up ID to Val(ID) and even IncrementValue(Val(ID)), but all it ever returns is either 0 or 1, respectively. Apparently ID is not getting converted. "I feel like I'm taking crazy pills!" What is wrong with converting a string to a number, especially when the string is just a concatenation of numbers? Many thanks, Sam The value "" cannot be converted to a number 155 : #ID# 156 : [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: paragraph formatting using nText with SQL Server
Thanks very much for the advice. I'll give it a try. -Sam - Original Message - From: Matthew Walker To: CF-Talk Sent: Wednesday, October 22, 2003 8:11 PM Subject: RE: paragraph formatting using nText with SQL Server Right well I think the best solution is to write your raw data to the database. When you want to display the data from the database use #paragraphFormat(myData)#. It's much like you wouldn't expect to display a date straight out of a database - you'd need to apply dateFormat() first. Alternatively you ould strip HTML when you edit, but that would be inelegant. Another alternative would be to use a WYSIWYG field. HTMLArea is cool and free for example. There are richer commercial options but this is a good starting point. -Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Thursday, 23 October 2003 12:06 p.m. To: CF-Talk Subject: Re: paragraph formatting using nText with SQL Server Hey thanks, Matthew. I just put it to work and it appears to be doing the trick. But you're right, I'd prefer not to see the . How do I hide them? -Sam - Original Message - From: Matthew Walker To: CF-Talk Sent: Wednesday, October 22, 2003 7:43 PM Subject: RE: paragraph formatting using nText with SQL Server You can use the paragraphFormat() built in CF function. People usually prefer to apply this only when the data is displayed. When you edit the data in your table, your probably won't want to see the tags, right? -----Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Thursday, 23 October 2003 11:36 a.m. To: CF-Talk Subject: paragraph formatting using nText with SQL Server Hi, Can anyone tell me how to maintain paragraph formatting for textarea going into SQL server (nText data type)? Preferably without VB. Should I assess the existence of three or more contiguous spaces and then insert a \ in the text where they occur before cfquery INSERT/UPDATE? Thanks, Sam _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: paragraph formatting using nText with SQL Server
Hey thanks, Matthew. I just put it to work and it appears to be doing the trick. But you're right, I'd prefer not to see the . How do I hide them? -Sam - Original Message - From: Matthew Walker To: CF-Talk Sent: Wednesday, October 22, 2003 7:43 PM Subject: RE: paragraph formatting using nText with SQL Server You can use the paragraphFormat() built in CF function. People usually prefer to apply this only when the data is displayed. When you edit the data in your table, your probably won't want to see the tags, right? -Original Message----- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Thursday, 23 October 2003 11:36 a.m. To: CF-Talk Subject: paragraph formatting using nText with SQL Server Hi, Can anyone tell me how to maintain paragraph formatting for textarea going into SQL server (nText data type)? Preferably without VB. Should I assess the existence of three or more contiguous spaces and then insert a \ in the text where they occur before cfquery INSERT/UPDATE? Thanks, Sam _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
paragraph formatting using nText with SQL Server
Hi, Can anyone tell me how to maintain paragraph formatting for textarea going into SQL server (nText data type)? Preferably without VB. Should I assess the existence of three or more contiguous spaces and then insert a \ in the text where they occur before cfquery INSERT/UPDATE? Thanks, Sam [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: error: object expected
Thanks, Ian. As you pointed out, the #-sign was needed around "country" in the option tag. I might never have caught it. After running a check to see other occurrences of it in my site, I found that that was an exception, a typo, and that none of the other instances of country select tags had the problem. Following your advice, I viewed the source of my page from the browser. The error almost always seems to draw from a line in which I'm processing an integer as real datatype. For example, this is a beginning line that drew an error: if ((!_CF_checkrange(_CF_this.Score.value, 0, 300))) { if (!_CF_onError(_CF_this, _CF_this.Score, _CF_this.Score.value, "Error in Score text.")) { return false; } and here's the CFML that might have generated it: Remarkably, all of my variables are getting passed to my action page and then inserted into the DB. If the fields are left blank, they turn into zeros when inserted into SQL real datatype variables. When I return to the input page, the defaults all show up as they should unless I left them blank, in which case they appear as 0 (minus the decimal because of the #INT()# function). I do not get any errors in Netscape 7.1. Perhaps I'm having a datatype issue between real types and null values - something IE can't handle? Thanks so much for your help. -Sam - Original Message - From: Ian Skinner To: CF-Talk Sent: Monday, October 13, 2003 5:00 PM Subject: RE: error: object expected A couple of thoughts. Don't know if you copied your code or typed it into this email? But if you copied it, I suspect you really want ="#country#" otherwise all your selects will have the value of "COUNTRY". Also, realize that the reference to the error (line 25, char 2) is for the GENERATED HTML OUTPUT and most likely does not have any relevance to the line numbers in your CFML code file. What I usually do, is View Source and cut and paste that into a new document in my IDE editor. Then I can find out what the Line 25, char 2 really refers to. Usually when I get that error.object.expected error, I am trying to do something to a variable or literal, that I thought referred to an DOM object, but actually doesn't, because I haven't mapped it properly. I would need to see more of your code to check that out, particularly the _javascript_ in question. But I'm out of here for the day, so probably won't get a chance to reply again till late tonight or sometime tomorrow. HTH -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA -Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 12:27 PM To: CF-Talk Subject: Re: error: object expected Thanks for the tip, Ade. Before I try cfdump, I wanted to let you know that the error does not occur in Netscape 7.1. -Sam - Original Message - From: Adrian Lynch To: CF-Talk Sent: Monday, October 13, 2003 11:43 AM Subject: RE: error: object expected I think for xhtml you should look to put the form outside the table. As for the error, I doubt it is to do with the message attribute of your option tag. Forget about the html for a while and just output the query. Try using to have a look at the query. Ade -Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: 13 October 2003 16:38 To: CF-Talk Subject: error: object expected Hi everyone. Thanks to Lee and Ian for helping me last time with "dynamic menus." I was able to get into the webmonkey tutorial Ian recommended and also have absorbed Lee's technique for meshing HTML form elements with cfinput tags. THanks guys. I am having another issue now. I keep getting a "java run-time error" on windows xp, and "error:object expected" on Win 2k. I'm not sure if mixing the form elements of CFML and HTML has caused the issue. I don't think so actually because they work really well. Here's what I've got for that: selected>--Select-- value="Country" message="Enter your country.">#Country# Perhaps I shouldn't put the message attribute in the tag. The line where the error occurs is line 25 (char 2), which relates to a tag. Can I put form elements inside of tables? Perhaps this is an IE thing? Thanks, Sam _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: error: object expected
Thanks for the tip, Ade. Before I try cfdump, I wanted to let you know that the error does not occur in Netscape 7.1. -Sam - Original Message - From: Adrian Lynch To: CF-Talk Sent: Monday, October 13, 2003 11:43 AM Subject: RE: error: object expected I think for xhtml you should look to put the form outside the table. As for the error, I doubt it is to do with the message attribute of your option tag. Forget about the html for a while and just output the query. Try using to have a look at the query. Ade -Original Message- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: 13 October 2003 16:38 To: CF-Talk Subject: error: object expected Hi everyone. Thanks to Lee and Ian for helping me last time with "dynamic menus." I was able to get into the webmonkey tutorial Ian recommended and also have absorbed Lee's technique for meshing HTML form elements with cfinput tags. THanks guys. I am having another issue now. I keep getting a "java run-time error" on windows xp, and "error:object expected" on Win 2k. I'm not sure if mixing the form elements of CFML and HTML has caused the issue. I don't think so actually because they work really well. Here's what I've got for that: selected>--Select-- value="Country" message="Enter your country.">#Country# Perhaps I shouldn't put the message attribute in the tag. The line where the error occurs is line 25 (char 2), which relates to a tag. Can I put form elements inside of tables? Perhaps this is an IE thing? Thanks, Sam _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
error: object expected
Hi everyone. Thanks to Lee and Ian for helping me last time with "dynamic menus." I was able to get into the webmonkey tutorial Ian recommended and also have absorbed Lee's technique for meshing HTML form elements with cfinput tags. THanks guys. I am having another issue now. I keep getting a "java run-time error" on windows xp, and "error:object expected" on Win 2k. I'm not sure if mixing the form elements of CFML and HTML has caused the issue. I don't think so actually because they work really well. Here's what I've got for that: --Select--#Country# Perhaps I shouldn't put the message attribute in the tag. The line where the error occurs is line 25 (char 2), which relates to a tag. Can I put form elements inside of tables? Perhaps this is an IE thing? Thanks, Sam [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Re:dynamic menus
Thanks, L. Unfortunately I'm dense and am having trouble making sense of the code you sent me. Suppose I have two lookup tables, (a) is for three types of Apples [red, golden, grannysmith], and the other (b) is for Nuts [walnut, chestnut, pecan, peanut]. The criteria are such that 1) Each Apple-type can have only one Nut-type. 2) red apples can only be paired up with a chestnut or a pecan. 3) golden apples can only be paired up with a walnuts or a chestnut. 4) grannysmith apples can only be paired up with any type of nut. -I write a query to get all of my Apples listed in a drop-down menu. -I write a query for each situation possibly selected. So for red I'd write something like: SELECT nut FROM tblNUTS WHERE nut = 'chestnut' OR nut = 'pecan' So how do I create the form? I guess I'm not understanding how multiple lists can be mixed and matched. I still feel that I need a switch to handle the specific cases. Perhaps I'm not looking for a dynamic menu system. Anyway, sorry to bug you again. Your help is very welcome. Thanks, -S - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: CF-Talk Sent: Sunday, September 28, 2003 4:40 PM Subject: Re:dynamic menus Try this. I'm a big fan of NOT using CFFORM etc. Note the onChange event - very straightforward. And this way you need only one list (no case statement needed). == SELECT author_id, author_first_name FROM author ORDER BY author_first_name -- SELECT -- selected>#author_first_name# = [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
dynamic menus
Hi Everyone,I am having trouble again. I'm trying to create my first dynamic menu drop-down list. Unfortunately, I don't know how to get the page to refresh (_javascript_:refresh(); ?) when a drop-down selection is made. The technique I've begun to set up is for the first menu to list some items. When one item is selected (don't know how to implement the onChange command with cfselect), the item value is stored in a variable, and then the page is refreshed to show that the new selection is "selected" (without being sent to a db). When the page is refreshed showing the selection, it also routes the selected value of the first list through a CFSWITCH tag, which determines the constituents of the second list. Creating the first list is what has me confused. But here's an example of the switch incase you see any problem swith it. SELECT* FROM [Lookup - Track] WHERE Track = 'BSHE' OR Track = 'BIOS' OR Track = 'EOH' OR Track = 'HPM' OR Track = 'IH' OR Track = 'EOHIH/GEH' --Select-- SELECT* FROM [Lookup - Track] WHERE Track = 'BIOS' OR Track = 'EPI' OR Track = 'PHI' OR Track = 'PN' OR Track = 'EOH/EPI' --Select-- Thanks,-S [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
Indeed it does. In fact, the problem actually stemmed from an incorrect operator that I used for concatenating another variable. I learned a lot from you. Thanks very much for your effort. As I move beyond newbie status, hopefully I can return the favor.-S - Original Message - From: Claude Schneegans To: CF-Talk Sent: Friday, September 26, 2003 2:32 PM Subject: Re: convert string of numbers to numeric? >>To help out a little more, here're my queries: So, does it work now? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
Problem solved. THanks for your help, everyone.-S - Original Message - From: Sam Fisher To: CF-Talk Sent: Friday, September 26, 2003 1:37 PM Subject: Re: convert string of numbers to numeric? Thanks for all of your help. To help out a little more, here're my queries: datasource="source" dbtype="ODBC"> INSERT INTO tblTable (name, var1) VALUES ('#userName.name#', '#val ("0" & form.var1)#') datasource="source" dbtype="ODBC">UPDATE tblTable SET var1=#val ("0" & form.var1)# WHERE name = '#userName.name#'--S - Original Message - From: Claude Schneegans To: CF-Talk Sent: Friday, September 26, 2003 12:38 PM Subject: Re: convert string of numbers to numeric? >>can you send the whole bit of code? Well, i don't where is the rest of the code, I just answered the problem "The value """" cannot be converted to a number." Adding "0" at the begining of the string will assure that the string is always transformable to a number through the val() function. Then if you are in a query, UPDATE myTable SET whatever = #val ("0" & form.var1)# [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
Thanks for all of your help. To help out a little more, here're my queries: datasource="source" dbtype="ODBC"> INSERT INTO tblTable (name, var1) VALUES ('#userName.name#', '#val ("0" & form.var1)#') datasource="source" dbtype="ODBC">UPDATE tblTable SET var1=#val ("0" & form.var1)# WHERE name = '#userName.name#'--S - Original Message - From: Claude Schneegans To: CF-Talk Sent: Friday, September 26, 2003 12:38 PM Subject: Re: convert string of numbers to numeric? >>can you send the whole bit of code? Well, i don't where is the rest of the code, I just answered the problem "The value cannot be converted to a number." Adding "0" at the begining of the string will assure that the string is always transformable to a number through the val() function. Then if you are in a query, UPDATE myTable SET whatever = #val ("0" & form.var1)# [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
in the cfinput tag. - Original Message - From: Claude Schneegans To: CF-Talk Sent: Friday, September 26, 2003 12:45 PM Subject: Re: convert string of numbers to numeric? >>I set the default value="0". In the database? The default valu in a database is returned when the field is null. But as soon as you insert or update a value with something, it's got to be a valid value or spcecifically null. An empty string is not a valid value. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
Yes, I set the default value="0".Thanks,-S - Original Message - From: Robertson-Ravo, Neil (RX) To: CF-Talk Sent: Friday, September 26, 2003 8:44 AM Subject: RE: convert string of numbers to numeric? Is form.var1 a valid string? i.e. is it empty? if it is the its not a valid string! From: Tony Weeg [mailto:[EMAIL PROTECTED] Sent: 26 September 2003 13:40 To: CF-Talk Subject: RE: convert string of numbers to numeric? can you send the whole bit of code? its got to work, there is a way!!! :) tony -Original Message----- From: Sam Fisher [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 5:21 PM To: CF-Talk Subject: Re: convert string of numbers to numeric? Thanks, Tony. Unfortunately it did not work. The error I continue to get is: The value """" cannot be converted to a number. I have also tried:with no success. Any thoughts? --S - Original Message - From: "Tony Weeg" <[EMAIL PROTECTED]&g! t; To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, September 25, 2003 3:33 PM Subject: RE: convert string of numbers to numeric? > simply stripping out the .'s maybe? > or is there something Im not getting? > > tony > > > > would do I presume? > > -Original Message- > From: Sam Fisher [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 3:30 PM > To: CF-Talk > Subject: convert string of numbers to numeric? > > Hi Everyone, > > I have a problem. I am trying to convert a string of numbers to a > real data > type, unfortunately without success. I read a CF-Talk board > discussion about it, but was unable to get it to work. Can anyone > help me. I created > an input field:> > > range="0.00,7.00" required="No" size="4" maxlength="4"> > > Now I need to convert var1 to a number before sending it through the INSERT > (SQL) query on my action page. What am I missing? > > Thanks > > --S > > > _[ Todays Threads [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: convert string of numbers to numeric?
Thanks, Tony. Unfortunately it did not work. The error I continue to getis:The value """" cannot be converted to a number.I have also tried:with no success. Any thoughts?--S- Original Message -From: "Tony Weeg" <[EMAIL PROTECTED]>To: "CF-Talk" <[EMAIL PROTECTED]>Sent: Thursday, September 25, 2003 3:33 PMSubject: RE: convert string of numbers to numeric?> simply stripping out the .'s maybe?> or is there something Im not getting?>> tony>> >> would do I presume?>> -Original Message-> From: Sam Fisher [mailto:[EMAIL PROTECTED]> Sent: Thursday, September 25, 2003 3:30 PM> To: CF-Talk> Subject: convert string of numbers to numeric?>> Hi Everyone,>> I have a problem. I am trying to convert a string of numbers to a realdata> type, unfortunately without success. I read a CF-Talk board discussion> about it, but was unable to get it to work. Can anyone help me. Icreated> an input field:>> > range="0.00,7.00" required="No" size="4" maxlength="4">>> Now I need to convert var1 to a number before sending it through theINSERT> (SQL) query on my action page. What am I missing?>> Thanks>> --S>>> [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
convert string of numbers to numeric?
Hi Everyone, I have a problem. I am trying to convert a string of numbers to a real data type, unfortunately without success. I read a CF-Talk board discussion about it, but was unable to get it to work. Can anyone help me. I created an input field: Now I need to convert var1 to a number before sending it through the INSERT (SQL) query on my action page. What am I missing? Thanks --S ~| ColdFusion MX 6.1, now 2.5 times faster. http://www.macromedia.com/software/coldfusion/productinfo/upgrade/jump/introducing.html?trackingid=ColdFusion_468x60g_HouseofFusion_carat_082803 Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138526 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4