[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: input type=radio в форме на js
Страницы: 1, 2
Lawyer
// radio
var radio = $('input[name="radio"]:checked').val();
Lawyer
Все изменения, не знаю насколько правильно, но 100% работают :blink:

send-mail.php


//data
$msg = “NAME:.$_POST['name'] .\n”;
$msg .= “EMAIL:.$_POST['email'] .\n”;
$msg .= “COMMENTS:.$_POST['comments'] .\n”;
$msg .= “RADIO:.$_POST['radio'] .\n”;



index.html


<div>
<input
name="radio" id="radio1" type="radio" title="This is radio 1" value="value1" onfocus="defaultInput(this,'This is radio 1')" onblur="clearInput(this,'This is radio 1')" checked />This is radio 1
<input name="radio" id="radio2" type="radio" title="This is radio 2" value="value2" onfocus="defaultInput(this,'This is radio 2')" onblur="clearInput(this,'This is radio 2')" />This is radio 2
<input name="radio" id="radio3" type="radio" title="This is radio 3" value="value3" onfocus="defaultInput(this,'This is radio 3')" onblur="clearInput(this,'This is radio 3')" />This is radio 3
</div>



formy.js


// radio
var radio = $(input[name="radio"]:checked).val();


// Create the data string
var dataString = 'name='+ name
+ '&email=' + email
+ '&comments=' + comments
+ '&radio=' + radio
+ '&to=' + to
+ '&from=' + from
+ '&subject=' + subject;

Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.