2016-08-04 29 views
-1

當用戶選擇「您的浸信會健康體驗」時。我如何最好地將「名稱和聯繫人信息」輸入字段的客戶端驗證應用於此?如何最好地將客戶端驗證添加到這兩個字段

<ul class="textinput reason gridA"> 
    <li><p class="feedback"><label><input runat="server" type="radio" name="feedbackreason[]" aria-label="What would you like to tell us about?" aria-valuetext="Your Baptist Health experience" title="What would you like to tell us about?: Your Baptist Health experience" id="bhexperience" class="feedbackreason reqType" value="bd" clientidmode="Static" /> Your Baptist Health experience</label></p></li> 
    <li class="block panel-content marginT20"> 
     <div class="hidePanel" style="display:none"> 
     <p class="hl4">To enable us to respond to your comments, would you please let us know who to contact?</p> 
     <p class="marginT10 marginL10"><label for="feedbackName" class="alignL">Name:</label><input type="text" name="feedbackName" id="feedbackName" class="text feedbackName marginL5" title="feedback Name" /><br /> 
     <br /> 
     <label for="contactInfo" class="alignL">Contact Information:</label><input type="text" name="contactInfo" id="contactInfo" class="text contactInfo marginL5" title="Contact Information" /></p> 
     <p class="hl4 marginT10">For immediate patient portal service, please call 
     <br /> 
     <strong><a class="phoneCall" style="color: mediumvioletred" href="tel:18446220622">1.844.622.0622</a></strong> (toll-free, 24/7)</p>  
     </div> 
    </li> 
</ul> 
+0

只是試圖要求用戶輸入一個名稱。你想要驗證什麼? – cmac

+0

我已經設置了這個JSFiddle https://jsfiddle.net/zfjy3r2u/#&togetherjs=EHz01Pzt2r –

回答

0

新增需要到要強制用戶填寫的輸入元素。

<ul class="textinput reason gridA"> 
    <li> 
    <p class="feedback"> 
     <label> 
     <input runat="server" type="radio" name="feedbackreason[]" aria-label="What would you like to tell us about?" aria-valuetext="Your Baptist Health experience" title="What would you like to tell us about?: Your Baptist Health experience" id="bhexperience" 
     class="feedbackreason reqType" value="bd" clientidmode="Static" /> Your Baptist Health experience</label> 
    </p> 
    </li> 
    <li class="block panel-content marginT20"> 
    <div class="hidePanel" style=""> 
     <p class="hl4">To enable us to respond to your comments, would you please let us know who to contact?</p> 
     <p class="marginT10 marginL10"> 
     <label for="feedbackName" class="alignL">Name:</label> 
     <input type="text" name="feedbackName" id="feedbackName" class="text feedbackName marginL5" title="feedback Name" required> 
     <br /> 
     <br /> 
     <label for="contactInfo" class="alignL">Contact Information:</label> 
     <input type="text" name="contactInfo" id="contactInfo" class="text contactInfo marginL5" title="Contact Information" required> 
     </p> 
     <p class="hl4 marginT10">For immediate patient portal service, please call 
     <br /> 
     <strong><a class="phoneCall" style="color: mediumvioletred" href="tel:18446220622">1.844.622.0622</a></strong> (toll-free, 24/7)</p> 
    </div> 
    </li> 
</ul> 
相關問題