2017-04-12 109 views
-1

改變文本框的值,asp的嚮導,我有我的code.in的一步我已經textbox.when我填寫文本框的ASP嚮導,我可以去其他step.when我在第二步,我想當點擊步驟,之前的按鈕(走一步一個)。我想添加到文本框的空間charackter.this代碼不爲什麼我不能的jQuery

$('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').click(function() { 
 
     
 
    $('input#uxInsertTitle').val(' '); 
 

 
    });
<!DOCTYPE html> 
 

 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head runat="server"> 
 
    
 

 

 
    <title></title> 
 
    <link href="Css/bootstrap.min.css" rel="stylesheet" /> 
 
    <link href="wizard/css/gsdk-base.css" rel="stylesheet" /> 
 
    <link href="Css/font/fonts.css" rel="stylesheet" /> 
 
    <link href="Css/font-awesome.css" rel="stylesheet" /> 
 
    <style type="text/css"> 
 
    
 
     
 
    </style> 
 

 
</head> 
 
<body dir="rtl" style="font-family: WebYekan !important;"> 
 

 
    <form id="form1" runat="server"> 
 

 
     <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
 
     <%-- <asp:UpdatePanel ID="pp" runat="server"> 
 
      <ContentTemplate>--%> 
 
       <div class="container"> 
 
        <div class="row"> 
 
         <div class="col-sm-10 col-sm-offset-1"> 
 
          <div class="wizard-container"> 
 
           <%-- CssClass="card wizard-card ct-wizard-orange"--%> 
 
           <%--ActiveStepIndex="0" --%> 
 
           <asp:Wizard ID="Wizard1" DisplaySideBar="false" CssClass="card wizard-card ct-wizard-orange vr" OnFinishButtonClick="Wizard1_FinishButtonClick" runat="server" OnNextButtonClick="Wizard1_NextButtonClick"> 
 
            <StartNextButtonStyle CssClass="StandardButton StartNextButton" /> 
 
            <StepNavigationTemplate> 
 
             <asp:Button runat="server" CausesValidation="False" CommandName="MovePrevious" CssClass="btn btn-primary" Text="Previous" ID="StepPreviousButton"></asp:Button> 
 
             <asp:Button runat="server" CommandName="MoveNext" CssClass="btn btn-primary" OnClick="StepNextButton_Click" Text="Next" ID="StepNextButton"></asp:Button> 
 
            </StepNavigationTemplate> 
 
            <WizardSteps> 
 
             <asp:WizardStep ID="WizardStep0" Title="عنوان پیشنهاد" EnableTheming="true"> 
 
              <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> 
 
               <AjaxSettings> 
 
                <telerik:AjaxSetting AjaxControlID="uxSimilarSuggestion1"> 
 
                 <UpdatedControls> 
 
                  <telerik:AjaxUpdatedControl ControlID="uxSimilarSuggestion1" /> 
 
                 </UpdatedControls> 
 
                </telerik:AjaxSetting> 
 
                <telerik:AjaxSetting AjaxControlID="uxSimilarSuggestion2"> 
 
                 <UpdatedControls> 
 
                  <telerik:AjaxUpdatedControl ControlID="uxSimilarSuggestion2" /> 
 
                 </UpdatedControls> 
 
                </telerik:AjaxSetting> 
 
                <%-- <telerik:AjaxSetting AjaxControlID="uxRelatedOrganizationComponentOfSuggestionPanel"> 
 
      <UpdatedControls> 
 
       <telerik:AjaxUpdatedControl ControlID="uxRelatedOrganizationComponentOfSuggestionPanel" /> 
 
      </UpdatedControls> 
 
     </telerik:AjaxSetting>--%> 
 
               </AjaxSettings> 
 
              </telerik:RadAjaxManager> 
 
             
 
              <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel2" Direction="RightToLeft" 
 
               HorizontalAlign="Center" Transparency="35"> 
 
               <table style="width: 100px; height: 100px; position: absolute; top: 0px; left: 0px; background-color: gray; opacity: 0.5; filter: alpha(opacity:50); vertical-align: middle; text-align: center; display: none; z-index: 10000;"> 
 
                <tr> 
 
                 <td> 
 
                  <table align="center" style="opacity: 0.5; filter: alpha(opacity:50); background-color: #585858; vertical-align: middle; text-align: center; border: 1px black solid; padding: 5px; position: fixed; top: 100px; right: 50%;" 
 
                   cellpadding="0" cellspacing="0"> 
 
                   <tr> 
 
                    <td> 
 
                     <span style="color: White; font-size: 12pt; font-weight: bold; font-family: Tahoma;">لطفا چند لحظه صبر كنيد...</span> 
 
                    </td> 
 
                    <td> 
 
                     <asp:Image runat="server" ID="uxLoading" ImageUrl="~/UserControl/Admin/Image/loading.gif" /> 
 
                    </td> 
 
                   </tr> 
 
                  </table> 
 
                 </td> 
 
                </tr> 
 
               </table> 
 
              </telerik:RadAjaxLoadingPanel> 
 
              <table style="margin-right: 20px; margin-top: 10px; line-height: 34px;"> 
 
               <tr> 
 
                <td class="Td1" style="width: 110px;">نام : 
 

 

 
               
 

 
                </td> 
 
                
 
               </tr> 
 

 

 

 
              
 

 

 
               
 

 
               <tr> 
 
                
 
                <td class="Td2"> 
 
                 <asp:Panel runat="server" ID="uxSimilarSuggestion1"> 
 
                  
 
                  <asp:TextBox ID="uxInsertTitle" ClientIDMode="Static" runat="server" Width="420px" Text='<%# Bind("Title") %>' 
 
                   autocomplete="off" onkeyup="textCounter();" Style="position: relative; left: 0px; top: 0px" onkeydown="textCounter();" 
 
                   CssClass="StandardFont SuggestionTitle" onfocus="show()" onblur="hide()" OnTextChanged="uxInsertTitle_TextChanged" AutoPostBack="true" onchange="HideForm();"></asp:TextBox> 
 

 

 
                  
 
                 </asp:Panel> 
 
                </td> 
 

 

 
               </tr> 
 

 

 
               <tr> 
 

 
                <td class="Td1"></td> 
 

 
                <td class="Td2"> 
 

 
                 <asp:Button ID="searchreg" runat="server" Width="203px" CssClass="btn " BackColor="#2a77ba" ForeColor="White" OnClientClick=" return false;" Text="جستجوی معمولی"></asp:Button> 
 

 
                 
 
                </td> 
 

 

 

 
               </tr> 
 

 
               
 
              </table> 
 

 

 
             </asp:WizardStep> 
 
             <asp:WizardStep ID="WizardStep1" runat="server" Title="شرح "> 
 
              <div id="stepthreee" style="margin: 10px 15px; text-align: center; width: 91%; padding: 5px; background-color: rgb(232,232,232); font-size: 12px; border-radius: 6px;"> 
 

 
              
 
              <asp:Label ID="titlesteptwo" runat="server"></asp:Label> 
 
              </div> 
 
              <%--//Start Add Sbr 1395-05-18 --%> 
 
              <table style="margin: 20px auto; width: 95%;"> 
 
               </table> 
 

 
                </asp:WizardStep> 
 

 

 

 
</body> 
 
<script src="wizard/js/jquery-1.10.2.js" type="text/javascript"></script> 
 
<script src="wizard/js/bootstrap.min.js" type="text/javascript"></script> 
 
<!-- plugins \t --> 
 
<script src="wizard/js/jquery.bootstrap.wizard.js" type="text/javascript"></script> 
 

 
<script> 
 
    
 

 

 
    //Add End Doc 
 

 
    
 
    
 

 
    
 

 
    $(document).ready(function() { 
 

 
     $("#uxInsertTitle").bind("change", EnableNextButton); 
 

 
     $("input#uxInsertTitle").bind("change", checkBoxChecked); 
 
     DisableEnableButton(); 
 
     DisableEnableButtonCp(); 
 
     
 

 
     var button = jQuery(".StartNextButton") 
 
     
 

 
     $('#Wizard1_StartNavigationTemplateContainerID_StartNextButton').addClass('btn btn-primary'); 
 
     $('#Wizard1_StartNavigationTemplateContainerID_StartNextButton').val('مرحله بعد'); 
 
     $('#Wizard1_StartNavigationTemplateContainerID_StartNextButton').css('float', 'left !important'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepNextButton').addClass('btn btn-primary btnLeft'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepNextButton').val('مرحله بعد'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').addClass('btn btn-danger'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').val('مرحله قبل'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').addClass('btn btn-success'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').val('اطلاعات وارد شده مورد تایید می باشد- ارسال'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishPreviousButton').addClass('btn btn-danger'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishPreviousButton').val('مرحله قبل'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepNextButton').css('float', 'left !important'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepNextButton').css('margin', '5px'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').css('float', 'right !important'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').css('width', '130px'); 
 
     $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').css('margin', '5px'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').css('float', 'right !important'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').css('margin-right', '360px'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').css('width', '250px'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishButton').css('margin-bottom', '-40px'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishPreviousButton').css('float', 'right !important'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishPreviousButton').css('margin', '12px'); 
 
     $('#Wizard1_FinishNavigationTemplateContainerID_FinishPreviousButton').css('width', '130px'); 
 

 

 

 

 
    }); 
 

 
    function EnableNextButton() { 
 

 
     var button = jQuery(".StartNextButton") 
 
     var checkBox = jQuery(".AcceptedAgreement input:checkbox"); 
 

 
     if (checkBox.is(':checked')) { 
 
      button.removeAttr("disabled"); 
 
      $('.InsertRow').show(); 
 
     
 
     
 
     } 
 
     else { 
 
      button.attr("disabled", "disabled"); 
 
     } 
 

 
    } 
 

 

 

 
    $('#Wizard1_StepNavigationTemplateContainerID_StepPreviousButton').click(function() { 
 

 
     var formElements = $('#Wizard1_uxSimilarSuggestion1').find('#lblTotalCharacter').text(); 
 
     
 
     alert(formElements); 
 
     $('input#uxInsertTitle').val('k'); 
 
     $("#uxInsertTitle").val("kd"); 
 

 
    
 

 
    }); 
 

 
</script> 
 
</html>

工作。

+0

我添加報警代碼,在步驟二中點擊StepPreviousButton當代碼沒有發現那位文本框和變化值。爲什麼沒有發現? –

+1

沒有包括你的HTML代碼,這將是很難爲我們指出錯誤所在 –

+0

請提供完整的片段與HTML和jQuery代碼 –

回答

0

使用元件的ID不這些元素的as.net編碼ID。
請嘗試以下代碼。

$('#StepPreviousButton').click(function() {  
    $('#uxInsertTitle').val(' '); 
}); 

例如:
如果有一個標籤這樣<asp:Label ID="lblMsg" runat="server"></asp:Label>然後用ID作爲lblMsg而不是asp.net編碼ID。

下面是一些參考示例,以使U明白我的意思。
Ref:Click HERE


GOT IT?

+0

這問題不涉及id。你說。當點擊鈕去點擊功能。也沒有找到,而不是改變文本框 –

+0

你可以在這裏發佈的是按鈕和文本框元素? –

相關問題