So I'm posting this as an answer because I'm showing you code, but this is only one solution to many. This is meant for a custom controller that is handled by a button on your Visualforce page.. So say you have button Submit on your VF page, you would check what ever data
before you save by using your getters and setters that is coming from your inputText. This was my solution which was a VF Page controlled by a custom controller. Granted you won't be using this exact code, this just may give you ideas to create your own
VF PAGE
<apex:pageMessages id="feedback" escape="false" />
public void prepareDataForSave()
{
Boolean result = true;
missingDataError = '';
if(transportationWrapper.transportRequested)
{
if(transportationWrapper.type == 'None')
{
missingDataError += '<br /> ' + VEHICLE_TYPE_MUST_BE_SELECTED;
result = false;
}
}
if(specSelected)
{
if(tripWrapper.amenityAmmount.Budget__c <= 0)
{
missingDataError += '<br /> ' + BUDGET_IS_REQUIRED;
result = false;
}
if(String.isBlank(specialAmenitiesWrapper.description))
{
missingDataError += '<br /> ' + DESCRIPTION_IS_REQUIRED;
result = false;
}
}
if(maximumOccupancy != null)
{
if(numberofAdults + numberOfChildern > maximumOccupancy)
{
if(!tripWrapper.overOccupancyLimitConfirmation || tripWrapper.resolutionTextBlockArea == null || String.isBlank(tripWrapper.resolutionTextBlockArea))
{
missingDataError += '<br /> ' + OVER_OCCUPANCY_WARNING;
result = false;
}
}
}
if(contactPlannerSelected && unknownPlannerSelected)
{
missingDataError += '<br /> ' + ONLY_ON_PLANNER_CONTACT_CAN_BE_SELECTED;
result = false;
}
if(result)
{
Submit(result);
}
else
{
displayFeedback(ApexPages.Severity.Error, String.valueOf(ERROR_SAVING_DATA + missingDataError));
missingDataError = '';
}
}
// User feedback
// ApexPages.Severity Reference: CONFIRM / ERROR / FATAL / INFO / WARNING
private void displayFeedback(ApexPages.Severity msgType, String message)
{
ApexPages.Message msg = new ApexPages.Message(msgType, message);
ApexPages.addMessage(msg);
}