2013-11-10 49 views
1

嗨,我堅持我當前的工作,因爲這個取消按鈕問題。取消按鈕HTML jQuery

在這裏,我將解釋我的問題有一些屏幕短褲 enter image description here

這是我的第一頁時,IAM點擊的第一個單選按鈕[獨特]它進入這個

enter image description here

在這裏,我想要當我點擊取消按鈕它回到第一個屏幕短,但是當我點擊它確實像DIS

enter image description here 這是馬全碼

<head> 
    <meta charset="utf-8" /> 

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery- 
ui.css" /> 
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> 
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> 
<style> 
    .raddiv{ 
     height: 30px;   
    } 
    .sitehtn{ 
    display: none 
      }   

    .container  
    { 
    width: 100%; 
    height: 600px; 
    background-color: rgb(179, 174, 174);   
    } 

    #datepickerT 
    { 
    margin-left: 2em; 
    } 

    .eventDateDiv 
    { 
    height: 150px; 
    width: 65%; 
    margin-left: auto; 
    margin-right: auto; 
    } 
    #daysBetween 
    { 
    margin-top: -1.4em; 
    margin-left: 30%; 
    } 
    .eventShowDiv 
    { 
    height: 306px; 
    width: 65%; 
    margin-left: auto; 
    margin-right: auto; 

    } 
    .event{ 
    color: green; 
    margin-top: 5px;} 
    </style> 
    <script> 
      $(function() { 
     $("#datepickerF").datepicker({ 
      showOn: "button", 
      buttonImage: "calendar.gif", 
      buttonImageOnly: true 
     }); 

    $("#datepickerT").datepicker({ 
       showOn: "button", 
      buttonImageOnly: true 
     }); 
$('#getdays').click(function() { 
    var start = $('#datepickerF').datepicker('getDate'); 
     var end = $('#datepickerT').datepicker('getDate'); 
     var days = (end - start)/1000/60/60/24; 
     document.getElementById("daysBetween").innerText=days; 

      }); 

    $(".radioBtn").click(function() { 
    $(".textBox").hide(); 
    if ($(this).attr("id") == "courtierRadio") { 
    $("#faderad").fadeOut(); 
    var is= $("#txt1, #txt2,#txt3,#getmrr,#rmvmrr") 
    is.show(); 

    } else if ($(this).attr("id") == "agenceRadio") { 
     $("#fadfirst").fadeOut(); 
    var vs=$("#txt5,#txt6,#txt7,#txt8").show(); 
    vs.show(); 
    } 

    }); 
     $("#getmrr").click(function() { 
     $('#mytable tbody>tr:last').clone(true).insertAfter('#mytable tbody>tr:last'); 
     return false; 

    }); 
    $("#rmvmrr").click(function() { 

     $("#mytable").remove(); 

     return false; 

    }); 
     function myFunction() 
     { 
     $("#getmrr").append(is); 
     } 
     }); 

     </script> 
       </head> 
     <body> 
    <div class="container"> 

     <div class="eventDateDiv"> 
      <div class="event"> 
       EVENT DATE 
      </div> 

      <p>FROM: <input type="text" id="datepickerF" /></p> 
      <p>To: <input type="text" id="datepickerT" /></p> 


      <button id="getdays">NO.OF DAYS </button> 
      <p id="daysBetween"> </p> 

     </div> 
     <div class="eventShowDiv"> 
      <div class="event"> 
       EVENT SHOW TIME 
      </div> 
      <p>TYPE OF SHOW: </p> 
    <div id="fadfirst" class="raddiv">   
       <label> 
     <input type="radio" name="sitewebGroup" value="Courtier" id="courtierRadio" 
    class="radioBtn" />Unique 
    </label> 
     <table id="mytable" width="500" > 
    <tbody> 
    <tr> 
<td> 
    <input type="text" name="site" class="sitehtn" id="txt1" /> 
    <input type="text" name="site" class="sitehtn" id="txt2" /> 
     <input type="text" name="site" class="sitehtn" id="txt3" /> 
    </td> 
    </tr> 
    </tbody> 
     </table> 
     <button id="getmrr" class="sitehtn" >addmore</button> 
     <button id="rmvmrr" class="sitehtn" >Cancel</button> 

    <br /> 
    </div> 
    <div id="faderad"> 
     <label> 
     <input type="radio" name="sitewebGroup" value="Agence" id="agenceRadio" 
    class="radioBtn" /> 
    Varied 
    </label> 

    <input type="text" name="textfield3" class="sitehtn" /> 

     <input type="text" name="textfield" class="sitehtn" id="txt5" /> 
      <input type="text" name="textfield" class="sitehtn" id="txt6" /> 
     <input type="text" name="textfield" class="sitehtn" id="txt7" /> 
      <input type="text" name="textfield" class="sitehtn" id="txt8" />    
</div>     
     </div> 
    </div> 
     </body> 
     </html> 

蔭剛newcommer這個所以請提供一些指導與valueble意見

+0

選擇 - >裁剪圖像 - >保存爲) –

回答

1

你需要告訴瀏覽器中顯示的,如果你想刪除它

「Varied」單選按鈕選項並隱藏「addmore」和「Cancel」按鈕。

更改與取消按鈕從

相關聯的點擊事件
$("#rmvmrr").click(function() { 

    $("#mytable").remove(); 

    return false; 

}); 

$("#rmvmrr").click(function() { 

    $("#mytable").remove(); 
    $("#faderad").show(); 
    $("#getmrr").hide(); 
    $("#rmvmrr").hide(); 

    return false; 

}); 

工作實施例here

+0

Thankx ...好友...代碼作品:-) – Manu

0

我認爲

$("#rmvmrr").click(function() { 

     $("#mytable").remove(); 

     return false; 

    }); 

到:

$("#rmvmrr").click(function() { 

     $("#mytable").hide(); 

     return false; 

    }); 

會做竅門來隱藏它。 我會說,多達移動的按鈕到表中,因爲他們出的標籤,並說:

$("#myTable").html(""); 
+0

:Thankx爲你的快速重播我編輯了我的代碼與你的,但它仍然給我輸出,我在第三屏幕顯示短。實際上我想,當我點擊取消butto它回到屏幕短1 ..是否有可能 – Manu

+0

我認爲無論你需要將兩個按鈕向上移動幾行,以便他們在標籤之前。讓我重新看一下代碼,以便我可以將您的複選框還給您! – samuraiseoul

+0

你有使用表格的原因嗎? – samuraiseoul