Suntower
Posts: 225
|
Posted: 04/06/2005, 2:52 PM |
|
OK, the more I get into CodeCharge the more I like it. The learning curve is like Everest but we're actually getting somewhere now. Cool!
Next problem...
I work with a lot of SQL databases with data converted over from legacy data stores. Which means that dates are stored as INTs and not in DATETIME format.
So for every grid or report I have to do a conversion function where I add a constant to the value in the table, then convert it to a date so that the ASP code formats it 00/00/0000.
But the -search- input forms are another story. I can't just use the toolbuilder for this. What I do is..
1. Make the input field for dates a text field.
2. Add code in the Event Before Build Select() like so..
SD.DataSource.Where = SD.DataSource.Where & " SOH.ShipDate= " & cLng(SDSearch.s_ShipDate.Value) + 36161)
Works fine. But...
Two problems:
1. I lose the input validation. Can one have 'date' validation on an input of type 'text'? If so, how?
2. Is there any way to avoid the Events? IOW: is there a 'trick' to doing the above type conversion in the Data Source window parameters/Query Builder?
TIA,
---JC
_________________
---On a campaign for more examples and better docs! |
|
|
hidran
Posts: 29
|
Posted: 04/20/2005, 8:24 AM |
|
You can set your textbox as date in property wondows of that field
and also set the format of the date so CCS can validate
the field and also in order to user a datepicker.
So , you don't need to hand code the search form to
make a textbox works as a field date.
I hope you understood my explanation.
|
|
|
Suntower
Posts: 225
|
Posted: 04/20/2005, 3:12 PM |
|
Sadly, I don't get what you mean. Can you (or someone else) please expand a bit?
TIA,
---JC
Quote hidran:
You can set your textbox as date in property wondows of that field
and also set the format of the date so CCS can validate
the field and also in order to user a datepicker.
So , you don't need to hand code the search form to
make a textbox works as a field date.
I hope you understood my explanation.
_________________
---On a campaign for more examples and better docs! |
|
|
Benjamin Krajmalnik
|
Posted: 04/26/2005, 5:08 PM |
|
JC,
I have moved mosy of my iput validation from server side validation to
client side validation in Javascript.
You can use regular expressions to validate.
For example, all of my date and time controls get processed through a set of
javascript functions which give me the same flexibility of date/time entry
you are used to in Clarion.
|
|
|
Suntower
Posts: 225
|
Posted: 04/26/2005, 5:35 PM |
|
Coool...
Care to help a brother out and give me a brief example to get me started?
TIA,
---JC
Quote Benjamin Krajmalnik:
JC,
I have moved mosy of my iput validation from server side validation to
client side validation in Javascript.
You can use regular expressions to validate.
For example, all of my date and time controls get processed through a set of
javascript functions which give me the same flexibility of date/time entry
you are used to in Clarion.
_________________
---On a campaign for more examples and better docs! |
|
|
|