mtsoulis
Posts: 17
|
Posted: 03/30/2015, 10:26 AM |
|
Sorry if I make easy questions but I'm new in this Forum..
so, I have 2 questions
1st. In a record form I have 2 textboxes: textbox1 and textbox2. I would like to have these conditions:
if textbox1 is null, textbox2 must be null
if textbox1 is not null, textbox2 must take the value "white"
2nd. How can I have dynamic values in my labels of my grid without to be important to reload my grid?
Thanks in advance!!
_________________
Miltos-Greece |
|
|
eratech
Posts: 513
|
Posted: 03/30/2015, 6:51 PM |
|
Hi mtsoulis and welcome.
For your first question I would look into the Help Manual for the 'On Validate' event for the record and perhaps put a 'Custom Code' block in (similar to this - pay attention to the '!' in front of the first check for textbox1):
if (!CCStrLen($Container->textbox1->GetValue()) && CCStrLen($Container->textbox2->GetValue())) {
// textbox1 has no 'length' but textbox2 does
$Container->textbox2->Errors->addError("Textbox 2 must be blank if Textbox 1 is blank");
}
if (CCStrLen($Container->textbox1->GetValue()) && $Container->textbox2->GetValue() != "white") {
// textbox1 has a length, and textbox2 does not equal "white"
$Container->textbox2->Errors->addError("Textbox 2 must be WHITE if Textbox 1 is not blank");
}
}
(You could also put some Input Validation details into the Textbox properties - but they can be a little trickier for multiple validation checks)
If you want to get examples of CCS code, try setting some of the 'Actions' and looking at the generated code - that is a handy guide. For example, add some 'Required Value' to get the syntax for your code, and then delete them if not required.
Dynamic Labels on Grid - Grids are usually 'display' instead of being dynamic after loading (depends on what you want to do obviously) so you could modify the Labels of the Grid before display (see 'Before Show' event for the Labels as you can change them before showing), but if you mean to change things after the Grid has loaded then you need to look at jquery.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
mtsoulis
Posts: 17
|
Posted: 03/31/2015, 10:30 AM |
|
Thank you very much Eric!
Miltos
_________________
Miltos-Greece |
|
|
|
|
|
|
|