Codecharger
|
Posted: 01/29/2004, 8:12 AM |
|
i need assistance
i have radio button and values of "yes" and "No" on the form.
how do i make "No" default value. no nothing is selected by default(now)
second
i want to make textbox format for amount or money..if somebody type 12 should be sumbited in database as $12.00
or
1214 should be sumbited as $12.04
any idea?
|
|
|
peterr
Posts: 5971
|
Posted: 01/29/2004, 4:08 PM |
|
If you used the dynamic Radio Button control in CCS then you can specify the default value in the "Default Value" property of the radio button.
Or if you implemented your radio button as HTML then you would use the standard HTML tag attributes used for this: http://www.google.com/search?q=html+radio+button+default
(looks like you need "Checked" attribute)
Regarding the input formatting, you can do a few things with the Client Action "Validate Entry". See "Data Entry page with Input Mask" example in CCS Example Pack: http://docs.codecharge.com/studio/html/ProgrammingTechn...xamplePack.html
Though in your case you may need to use the "Before Insert" and/or "Before Update" events to replace one value with another.
For example to convert "1214" into "$12.14":
RecordForm.Field1.Value = "$" & CLng(RecordForm.TextField1.Value) / 100
The above example is extremely simplified - do not use it as is, but modify it to perform whatever formatting you need. You may need to create some function that analyzes the entered value and converts it to the one you need.
You may also be able to find some useful VBScript functions on Google, although I doubt that any of them would convert 1214 into $12.14 instead of $1214.00.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
Codecharger
|
Posted: 01/30/2004, 9:40 AM |
|
wht's the right datatype in ms sql?
if i type in $12.14
all i get is 12
i havetried amount and numeric
|
|
|
peterr
Posts: 5971
|
Posted: 01/30/2004, 10:37 AM |
|
See: http://www.google.com/search?q=sql+server+numeric+datatypes http://www.mssqlserver.com/articles/datatypes_p3.asp
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
peterr
Posts: 5971
|
Posted: 01/30/2004, 2:03 PM |
|
BTW, you may also need to select "Float" in your "Data Type" property of your field/control in CCS.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|