HI,
I have searched the forums with no solution, have come close, but editing the syntax has not worked. The closest I came to a solution is: http://www.chronoengine.com/forums.html?cont=posts&f=7&t=12958#p25673
The goal: To get a single input box to validate against a table of values (server side) before submitting.
Details:
I have a table of membership numbers in the following table(jos_chrono_contact_num)
I have a form with the input name = member_number and a submit button
I need the user to input their member number, hit submit, if invalid, the user gets a message, otherwise the form submits.
I envision the flow as: the user types the correct number, hits submit, the $member_number is checked against the column member_number from the table jos_chrono_contact_num, and if they match, the form submits.
The following is what I have tried to put in the Server Side validation portion under the 'validation' tab without success:
Any help would be greatly appreciated.
I have searched the forums with no solution, have come close, but editing the syntax has not worked. The closest I came to a solution is: http://www.chronoengine.com/forums.html?cont=posts&f=7&t=12958#p25673
The goal: To get a single input box to validate against a table of values (server side) before submitting.
Details:
I have a table of membership numbers in the following table(jos_chrono_contact_num)
I have a form with the input name = member_number and a submit button
I need the user to input their member number, hit submit, if invalid, the user gets a message, otherwise the form submits.
I envision the flow as: the user types the correct number, hits submit, the $member_number is checked against the column member_number from the table jos_chrono_contact_num, and if they match, the form submits.
The following is what I have tried to put in the Server Side validation portion under the 'validation' tab without success:
<?php
$db =& JFactory::getDBO();
$text =& JRequest::getString('member_number');
$sql = "
SELECT COUNT(*)
FROM 'jos_chrono_contact_num'
WHERE 'member_number' = ".$db->quote($text).";";
$db->setQuery( $sql );
if ($text != $sql )
{echo "incorrect member number";}
else
{}
?>
Any help would be greatly appreciated.