CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Size of textbox tied to MSSQL column if numeric

Print topic Send  topic

Author Message
mayeski

Posts: 4
Posted: 04/20/2004, 4:22 PM

I'm having trouble understanding the HTML generated by CSS for numeric data in MSSQL For example, if the column is decimal(4,1), I want to allow no more than 4 numbers and a decimal, in the textbox. However, it appears that CSS sizes and maxsizes such a textbox with 12 characters, and then a DB error is of course returned if the textbox contains > 4 numbers. I know I can validate each of these values, but I have 101 tables (and 101 sets of search and add/edit pages) I am dealing with (so far). I can also choose to make each of these numbers chars instead in the db, but that has its own set of problems.

Perhaps I am doing something improperly, but I did not see a way to change this behavior using the App Builder. I'm using the latest version of CCS and SQL Server 2000.

Thanks in advance for any light on this subject.

- Simon.
View profile  Send private message
peterr


Posts: 5971
Posted: 04/20/2004, 5:34 PM

Rather than validating the data, you can limit the number of characters for each textbox by editing the "maxlength" attribute in HTML. You can do this directly in HTML, or edit the "maxlength" property of your controls in the Properties panel ("Format" tab).
This should be faster to implement than validation, although I understand that still time consuming.

I'm not sure why CCS does not do this automatically, whether due to a bug, lack of such feature, or problem with the database driver (not all drivers provide access to all the information that we may need). I'll check with our engineering if this is something that could be implemented in the future, but for now you may need to handle this manually.

Though if the database columns in question are named similarly (for example they begin with the same prefix), then you can use the Search & Replace feature in CCS to automatically replace the resultingHTML:
  <input maxlength="12" name="{ColumnNamePrefix
with
  <input maxlength="4" name="{ColumnNamePrefix

Or if the fields in question are the only ones that result in maxlength=12 then you can run Search & Replace to replace all occurences of
  maxlength="12"
with
  maxlength="4"
(please backup your project before running Search & Replace on the whole project)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mayeski

Posts: 4
Posted: 04/20/2004, 11:50 PM

Thanks, Peter.

I was aware that I could change maxlength, but had forgotten about Search/Replace - that would be easier, no doubt.

I was hoping there was a setting I had missed, but I guess not - seems like a bug, then, in how the CCS Studio code is handling SQL Server numerics. I'm surprised no one else has had this problem before - is no one else using SQL Server out there?

Here's hoping for a quick fix - but not really expecting one.

- Simon.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.