CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Making Checkboxes Required

Print topic Send  topic

Author Message
Natalie
Posted: 10/15/2002, 1:39 PM

Does anyone know how to make checkboxes required in Code Charge Studio? Regular Code Charge had this feature and I miss it.

Thanks.
Natalie
Natalie
Posted: 10/15/2002, 1:49 PM

I was able to edit the actual code, but in CCS when you edit the acutal code, Changes made in the editor (Design Mode) do not change in the changed area of the code section.

Is there a way around this?

Thanks :-)
Headhunter
Posted: 10/15/2002, 11:04 PM

Change the checkbox to text field,
make it required,
change the text field back to checkbox.

I hope yessoftware fixes this in the future.
Natalie
Posted: 10/17/2002, 3:16 PM

Thanks Headhunter :-)
Natalie
Posted: 10/17/2002, 9:23 PM

Well, I just tried this and it will not work. I am using drop down boxes instead, but I need to have a yes answer, if I require these fields and they select no, then I need a way to have the script stop the registration.

Can this be done?

Thanks
Natalie
Posted: 10/17/2002, 10:03 PM

Headhunter,

I got this figured out and it seems to be working real good.

I have made a manual edit in the code part of the form to read like this:

'Standard Check box code'
Set terms = CCCreateControl(ccsCheckBox, "terms", "Terms", ccsInteger, Empty, CCGetRequestParam("terms", Method))
terms.CheckedValue = 1
terms.UncheckedValue = 0

'My Addition'
if terms.UncheckedValue = 0 then
terms.Required = True
End If

Thanks again for your help.

Natalie
Natalie
Posted: 10/17/2002, 10:10 PM

I made a mistake.

It should be like this... Sorry.

Set terms = CCCreateControl(ccsCheckBox, "terms", "Terms", ccsInteger, Empty, CCGetRequestParam("terms", Method))
terms.CheckedValue = 1
terms.UncheckedValue = 0

if terms.Value = 0 then
terms.Required = True
End If

The UncheckedValue was giving the required error. I took that out and made it just, terms.Value and it workd GREAT.... so far :-)
Headhunter
Posted: 10/18/2002, 3:10 AM

Hm, strange.

I have the same problem, but in the other direction. (making checkbox not required). I solve this by changing like discribed earlier. I thought it would work in the other way to.

thanks for the info Natalie
Nicole
Posted: 10/19/2002, 1:07 AM

Hello,
Standard CCS checkbox field is always has a value, no matter if it is checked or unchecked. That’s why you have the ability to specify unchecked value (it is like default value for the field). So you do not need to make it required.

Also, just in case. If you get ‘the field value is required’ warning for the checkbox field, most probably you have changed the TextBox control to CheckBox. Required property of textbox was set to True. That’s why you see that checkbox required property is set to true in the code, although checkbox control doesn’t have required property. This is the reason of the problem. To overcome it, change control type back to TextBox, set Required to empty, switch back to CheckBox and regenerate the page.

   


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.