if statement with content of a form I searched a lot without success, i hope i can find the right answer for me.

I want to make a simple bet system, without any real money. At the time of the registration the user get x fakecredits. I decide to use the comment system to check how much the user wants to bet, so i added a field called bet to comment form.

What i want to do now is very simple as logic:

if (Bet &lt; User Money){
 submit content;
}else{
 don't submit;
}


i already made a view that shows user money. i only need the if statement. I also created a module with module_form_alter, but i don't know what to put then. 

Thanks in advance

Drupal version 7.x
Sounds like something to put in the field or form validation.

$form['#validate'][] = 'form_validate';


or 

$form['your_field']['#element_validate'] =&gt; array('_field_callback_validate'),