如何在下拉列表中启用单选按钮 [英] how to enable radio button in onchange of a drop down

查看:69
本文介绍了如何在下拉列表中启用单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Friends .......在我的项目中,我有一个下拉列表,并根据从下拉列表中选择的值,我必须启用2个单选按钮。在下拉的更改功能中,我已经编写了代码。但单选按钮未启用,它只是闪烁并被禁用。这是代码...默认情况下禁用单选按钮。[php]< select name =" tak"类= QUOT; style21" onChange =" tlkdisp(document.form1)>> function tlkdisp(Object)

{

var index = Object.tak.selectedIndex;

var value = Object.tak.options [index] .value;

if(Object.tak.options [index] .value> 0)

{

document.form1.radiobutton [0] .disabled = false;

document.form1.radiobutton [1] .disabled = false;

document.form1.radiobutton1 [0] .disabled = false;

document.form1.radiobutton1 [1] .disabled = false;

}

document.form1.action =" Vr.php?tak =" + value;

document.form1.submit();

return false;

} [/ php]

谢谢..............

Hello Friends....... in my project i am having a dropdown and based on the values selected from the dropdown, i have to enable 2 radio button. in the on change function of drop down i have written the code. but radio button is not getting enabled, it just blinks and get disabled. this is the code... radio button is disabled by default.[php]<select name="tak" class="style21" onChange="tlkdisp(document.form1)">function tlkdisp(Object)
{
var index=Object.tak.selectedIndex;
var value=Object.tak.options[index].value;
if(Object.tak.options[index].value >0 )
{
document.form1.radiobutton[0].disabled=false;
document.form1.radiobutton[1].disabled=false;
document.form1.radiobutton1[0].disabled=false;
document.form1.radiobutton1[1].disabled=false;
}
document.form1.action="Vr.php?tak="+value;
document.form1.submit();
return false;
}[/php]
thanks..............

推荐答案

看起来像javascript给我?这听起来像是你需要javascript的东西。 PHP无法单独执行此操作,因此如果您不想使用javascript,则需要使用AJAX。主持人应尽快将其移至javascript论坛。
Looks like javascript to me? And it sounds like something you would need javascript for anyway. PHP cannot do this alone, so if you don''t want to use javascript you will need AJAX. A moderator should move this to the javascript forum soon.


警告:


请将您发布的代码附在[代码]标签(请参阅如何提出问题)。


这使我们的专家更容易阅读和理解它。如果不这样做会给版主带来额外的工作,从而浪费资源,否则可以回答会员的问题。


请将来使用[code]标签。


MODERATOR
warning:

Please enclose your posted code in [code] tags (See How to Ask a Question).

This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members'' questions.

Please use [code] tags in future.

MODERATOR


这与PHP有什么关系?


我会把它移到JavaScript论坛。


版主
What has this got to do with PHP??

I''ll move this to the JavaScript forum.

moderator


这篇关于如何在下拉列表中启用单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆