<table> <tr> <td> <select id="cbo" name="cbo" onchange="chk_cbo()"> <option value="1">11111</option> <option value="2" selected>222222</option> <option value="3">333333</option> </select> </td> <td> <div id="cbo_data1" style="display:none">1111111111</div> <div id="cbo_data2" style="display:none">2222222222</div> <div id="cbo_data3" style="display:none">3333333333</div> </td> </tr> </table> <script> function chk_cbo(){ obj=document.getElementById("cbo"); if(obj.value=='1'){ document.getElementById("cbo_data1").style.display=""; document.getElementById("cbo_data2").style.display="none"; document.getElementById("cbo_data3").style.display="none"; } else if(obj.value=='2'){ document.getElementById("cbo_data1").style.display="none"; document.getElementById("cbo_data2").style.display=""; document.getElementById("cbo_data3").style.display="none"; } else if(obj.value=='3'){ document.getElementById("cbo_data1").style.display="none"; document.getElementById("cbo_data2").style.display="none"; document.getElementById("cbo_data3").style.display=""; } } chk_cbo(); </script>
<select id="sel" name="selty[]"> <!-- <option value="">----</option>--> <option value="text" <? if($array['type_q']=='text'){echo 'selected';}?>>text</option> <option value="checkbox" <? if($array['type_q']=='checkbox'){echo 'selected';}?>>checkbox</option> <option value="radio" <? if($array['type_q']=='radio'){echo 'selected';}?>>radio</option> </select> <div id="detail"> </div>
<script type="text/javascript"> $(function(){ $('#sel').change(function(){ var detail=$('#detail'); detail.empty(); var input=$('<input>').attr({'type':'text','name':'txt','value':'text'}); var chk=$('<input>').attr({'type':'text','name':'txt','value':'checkbox'}); var rd=$('<input>').attr({'type':'text','name':'txt','value':'radio'}); if($(this).val() == 'text'){ detail.html('<table class="table table-bordered"><tbody><tr><td> Type : Text<input id="price" name="ltid" value="text" size="5" type="hidden"> </td><input name="tid" type="hidden" value=""></tr></tbody></table>'); }else if($(this).val() == 'checkbox'){ detail.append('<table class="table table-bordered"><tbody><tr><td> Type : Checkbox<input id="price" name="ltid" value="checkbox" size="5" type="hidden"> </td><td>ตัวเลือก<input name="tid" type="text" value=""><br></td></tr></tbody></table>'); }else if($(this).val() == 'radio'){ detail.append('<table class="table table-bordered"><tbody><tr><td> Type : Radio<input id="price" name="ltid=" value="radio" size="5" type="hidden"> </td><td>ตัวเลือก<input name="tid" type="text" value=""><br></td></tr></tbody></table>'); }else{ detail.append('Please you select'); } }); }); </script>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง