Next to tackle....the following code, which worked nicely in V3, does not give any resukts in V4
I have put the param om 1, to be sure if more than 1 records would give the message
<?
$db =& JFactory::getDBO();
$pst = "SELECT COUNT(*) AS %s FROM %s
WHERE %s = %s";
$query = sprintf(
$pst,
$db->nameQuote('items'),
$db->nameQuote('j17_chronoforms_data_Test2'),
$db->nameQuote('Wedstrijddatum'),
$db->Quote(JRequest::getString('Wedstrijddatum')));
$db->setQuery($query);
$result = $db->loadObject();
$total = $result->items+1;
if (($total = $result->items+1)>1) {
Return "Here the message : too many etc etc";
}
?>
I have put the param om 1, to be sure if more than 1 records would give the message
Hi, please don't double post!! your question is already here:
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=65654&p=264807#p264793
http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=2&t=65654&p=264807#p264793
Sorry, the previous topic is solved now, but this
Customer Server Side Validation
If the nr of records exceeds a "value" it should return an error message
Tried the following, (with no success)
Customer Server Side Validation
If the nr of records exceeds a "value" it should return an error message
Tried the following, (with no success)
<?
$db =& JFactory::getDBO();
$pst = "SELECT COUNT(*) AS %s FROM %s
WHERE %s = %s";
$query = sprintf(
$pst,
$db->nameQuote('items'),
$db->nameQuote('j17_chronoforms_TEST3'),
$db->nameQuote('datum'),
$db->Quote(JRequest::getString('datum')));
$result = $db->loadObject();
$total = $result->items+1;
$form->data['total'] = $total;
if ($form->data['total']>1)
{
Return "Dear etc etc , sorry, etc etc";
}
?>
Sorry for bumping, but pls could you help, I'm now trying and trying, but I;m missing the point apperently
Hi SPABO,
If in doubt check the Help tab.
In CFV4 the syntax has changed: replace
Bob
If in doubt check the Help tab.
In CFV4 the syntax has changed: replace
Return "Dear etc etc , sorry, etc etc";
with $form->validation_errors['some_input_name'] = "Dear etc etc , sorry, etc etc";
return false;
Bob
Dear Bob,
I tried this as wel, however , it does not show any error message
This is what I now have put in:
I tried this as wel, however , it does not show any error message
This is what I now have put in:
<?
$db =& JFactory::getDBO();
$pst = "SELECT COUNT(*) AS %s FROM %s
WHERE %s = %s";
$query = sprintf(
$pst,
$db->nameQuote('items'),
$db->nameQuote('j17_chronoforms_TEST3'),
$db->nameQuote('datum'),
$db->Quote(JRequest::getString('datum')));
$result = $db->loadObject();
$total = $result->items+1;
$form->data['total'] = $total;
if ($form->data['total']>5){
$form->validation_errors['datum'] = "Dear etc etc , sorry, etc etc";
return false;}
?>
Yes.....It works now...
Also had to play around how to order the various events, and you must not put the Lopp Event on "Submit" !!
I have one moer question on this topic.
How to remove the text under the fieldname, see picture
Look forward hearing from you soon
Pls find the code as well
Also had to play around how to order the various events, and you must not put the Lopp Event on "Submit" !!
I have one moer question on this topic.
How to remove the text under the fieldname, see picture
Look forward hearing from you soon
Pls find the code as well
<?
$db =& JFactory::getDBO();
$pst = "SELECT COUNT(*) AS %s FROM %s
WHERE %s = %s";
$query = sprintf(
$pst,
$db->nameQuote('items'),
$db->nameQuote('j17_chronoforms_TEST3'),
$db->nameQuote('datum'),
$db->Quote(JRequest::getString('datum')));
$result = $db->loadObject();
$total = $result->items+1;
$form->data['total'] = $total;
if (($result->items+1)>5){
$form->validation_errors['datum'] =
"Helaas, het maximum aantal deelnemers is reeds bereikt!<br>
Stuur een e-mail naar de wedstrijdleiding als u op de<br>
reservelijst wenst te komen.";
return false;}
?>
Hi SPABO ,
I don't think you can - you could hide them with CSS or CSS + JavaScript though.
There is a setting on the Form General tab to turn off the Top Messages but I don't see any option to turn off the messages under the input.
Bob
I don't think you can - you could hide them with CSS or CSS + JavaScript though.
There is a setting on the Form General tab to turn off the Top Messages but I don't see any option to turn off the messages under the input.
Bob
This topic is locked and no more replies can be posted.