2011-01-25 43 views
0

我通过install1中的jQuery将页面加载到div中。 现在install1给我的页面包含几个单选按钮的喜欢:

<input name="ostype" type="radio" value="solaris"> 
<input name="ostype" type="radio" value="windows"> 

现在,我想在install2访问所选值。

下面是两个函数的JavaScript代码:

function install1() { 
    $("#installer").html("<div align='center'><img src='modules/servers/flosoftdedicated/images/ajax/loading-warning.gif' border='0' alt='' /><br />Loading...</div>"); 
    $.ajax({ 
    type: 'GET', 
    url: 'clientarea.php', 
    data: 'action=productdetails&id=' + $('#serverid').val() + '&modop=custom&a=installgetos&step=1', 
    timeout: 10000, 
    success: function(data){ 
     $("#installer").html(data); 
     }, 
    }); 
} 
function install2() { 
    $("#installer").html("<div align='center'><img src='modules/servers/flosoftdedicated/images/ajax/loading-warning.gif' border='0' alt='' /><br />Loading...</div>"); 
    $.ajax({ 
    type: 'GET', 
    url: 'clientarea.php', 
    data: 'action=productdetails&id=' + $('#serverid').val() + '&modop=custom&a=installgetos&step=2&ostype=' + $("input[name='ostype']:checked").val(), 
    timeout: 10000, 
    success: function(data){ 
     $("#installer").html(data); 
     }, 
    }); 
} 
+0

什么叫`install2()`? – 2011-01-25 01:33:38

回答

0

在你install2功能你通过调用$("#installer").html("<div align='center'>...和删除输入复位的install2 div的内容。

删除install2函数中的第一行。

相关问题