日期:2014-05-17  浏览次数:20431 次

单选框实现了切换,但提交表单后,怎么去获得提交的内容?
如题所示.百度了下,说是名字一样,但ID不同,通过数组来解决。但是我还是不得要领。先把切换的代码发上。
<form method="post" action="page-10.php">
<h3>你要进行的管理操作:</h3>
<label for="n1" class="red"><input name="myradio" id="n1" type="radio" value="alter" checked="checked" onclick="radioShow();" />修改</label>
<label for="n2" class="red"><input name="myradio" id="n2" type="radio" value="delete"  onclick="radioShow();" />删除</label>
<label for="n3" class="red"><input name="myradio" id="n3" type="radio" value="add"  onclick="radioShow();" />添加</label> 

                                                                   //该部分为单选框
------------------------------------------------      
     <div id="c">
<div class="c1">
<label for="aim">需要修改的书籍编号:<input name="cx[]" id="aim" type="text" value="" /></label><br/><br/>
<label for="title">书名<input name="cx[]" id="title" type="text" value="" /></label><br/><br/>
<label for="type">语言<input name="cx[]" id="type" type="text" value="" /></label><br/><br/>
<label for="author">作者<input name="cx[]" id="author" type="text" value="" /></label><br/><br/>
<label for="category">类别<input name="cx[]" id="category" type="text" value="" /></label><br/><br/>
<label for="numeber">书名<input name="cx[]" id="number" type="text" value="" /></label><br/><br/>
<label for="ok"><input name="cx" id="ok" type="submit" value="确定" /></label>
</div>
                                                            //这部分属于修改的几个文本框
------------------------------------------------
<div class="c2" style="display:none;">
<label for="goal">需要删除的书籍编号:<input name="cy" id="goal" type="text" value="" /></label>
<label for="yes"><input name="cy" id="yes" type="submit" value="确定" />
</div>
                                                         //删除的文本框
------------------------------------------------
<div class="c3" style="display:none;">
<label for="target">书籍编号:<input name="cz[]" id="atarget" type="text" value="" /></label><br/><br/>
<label for="atitle">书名<input name="