Is there a possible way to display error messages in on button submit

<table>
<tr>
<td>
<input type="text" id="country" class="custom2" /><span>Country</span>
</td>
<td>
<input type="text" id="city" class="custom2" /><span>City</span>
</td>
</tr>
</table>
Thanks
R