sashgera,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
$('[name="shipping_rate_id"]').click(function() {
$("#vm_myadres_input").toggle(this.value == 2);
})
$('form').submit(function() {
var text = '',
val = $.trim($('#vm_myname_field').val());
if (!val) {
text += ' <br>Заполните поле Имя '
}
val = $.trim($('#vm_myadres_field').val())
if (!val && $('#vm_myadres_field').is(':visible')) {
text += ' <br>Заполните поле Адрес '
}
$('#err_userfields').html(text)
return !text
})
});
</script>
</head>
<body>
<div id="err_userfields" class="err_valid" style="color:red; font-weight:bold;"></div>
<form action="index.php" method="post">
<input name="shipping_rate_id" id="zzz1" value="1" type="radio"> Самовывоз <em>(поле Адрес будет скрыто)</em>
<br>
<input name="shipping_rate_id" id="zzz2" value="2" type="radio"> Доставка по Москве <em>(поле Адрес будет показано)</em>
<br>
<br>
<div class="formField" id="vm_myname_input">
<input id="vm_myname_field" name="vm_myname" value="" class="inputbox" type="text"> Имя
</div>
<br>
<div class="formField" id="vm_myadres_input">
<input id="vm_myadres_field" name="vm_myadres" value="" class="inputbox" type="text"> Адрес
</div>
<br>
<input id="submit-form" type="submit" value="Оформить заказ" />
</form>
</body>
</html>