English 中文(简体)
如何在PHP中利用AJAX检查无线电纽扣值?
原标题:How to get checked radio button value using AJAX in PHP?

I m将在PHP中利用AJAX获得经过检查的无线电塔顿值。 我做了以下工作,但我可以继续这样做。

我需要你们的帮助。

ajax_radio.php>

<html>
  <head>
    <script type="text/javascript" src="ajax.js" ></script>
  </head>
  <body>
    <input type="radio" name="radio1">Blue</input>
    <input type="radio" name="radio2">White</input>
    <input type="radio" name="radio3">Red</input>
    <input type="button" name="btn" value="Click" onClick="hello( a )"></input><br />
   <input type="text" id="btn_get" name="get_btn_value"></input>
  </body>
</html>

ajax.js

var xmlHttp;
function GetXmlHttpObject(){
    try{
        xmlHttp = new XMLHttpRequest();
    }
    catch(e){
        try{
            xmlHttp = new ActiveXObject(Msxml2.XMLHTTP);
        }
        catch(e){
            try{
                xmlHttp = new ActiveXObject(Microsoft.XMLHTTP);
            }
            catch(e){
                alert("doesn t support AJAX");
                return false;
            }
        }
    }
}
function hello(a){
    GetXmlHttpObject();
    xmlHttp.open("GET","ajax_radio.html?",true);
    xmlHttp.onreadystatechange = response;
    xmlHttp.send(null);
}
function response(){
    if(xmlHttp.readyState == 4){
        if(xmlHttp.status == 200){
            var radio_text = xmlHttp.responseText;
            document.getElementById( btn_get ).innerHTML = radio_text;
        }
    }
}

你们是否知道如何完成这项工作? 预先感谢:

Edit:

由于网络速度低,我现在可以在此张贴该守则。 I m or。

我在rapidcomm上分享。 你们能够首先下载,然后帮助? 非常感谢。

我在回家时必须加以更新。 很差。

最佳回答
问题回答

暂无回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...