开发者

How to display error message in a jsp

开发者 https://www.devze.com 2023-04-08 11:51 出处:网络
if(e开发者_StackOverflowmailVal == \'\') { $(\"#email\").after(\'<span class=\"error\"><font color=\"red\">Please enter your email address.</span>\');
if(e开发者_StackOverflowmailVal == '') {
              $("#email").after('<span class="error"><font color="red">Please enter your email address.</span>');
              hasError = true;
          }

when i use above javascript, message displays besides email textbox

<form:input path="email"  id="email"/>
             <c:if test="${!empty is_exist_user}">
             <span class="error"><font color="red">${is_exist_user}</font></span>               
            </c:if>

but when i use above code in jsp file, message displays below email textbox, how can i get this textbox besides email textbox


Either use CSS to tweak whatever is produced by whatever custom tag that is, modify the html produced by that custom tag, or don't use the custom tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号