asp.net - How to reset this span's text generated from a regularExpressionValidator at asp with javascript -


itemprop = "text">

I block this HTML on an aspx page:

   Td class = "normalbold" & gt; & Lt; ASP: text box runat = "server" id = "txtSendSummary" ClientIDMode = "static" CssClass = "NormalTextBox" style = "width: 170px;" Enabled = "wrong" & gt; & Lt; / Asp: text box & gt; & Lt; ASP: RegularExpressionValidator id = "txtSendSummaryValidEmail" runat = "server" ClientIDMode = "static" ControlToValidate = "txtSendSummary" errorCare = "*" ValidationExpression = "\ w + ([- + '.] \ W +) * @ \ w + ([-.] \ W +) * \ \ w + ([-.] \ W +) * "/" & Lt; / TD & gt;   

I tried to restore it with "*".

  document.getElementById ('txtSendaryValidEmail') value = "";   

but still "*"! How can I reset this period of validation?

Thanks in advance!

You have two problems here at the first span > Value is not , so you will need to use innerText instead:

  document.getElementById ('txtSendaryValidEmail'). InnerText = "";   

The other problem you can face is that ASP.net ensures that id attributes on such elements are prefixing them unique Announcing your ID as txtSendSummaryValidEmail , the end result looks something like c001_c001_txtSendSummaryValidEmail .

On the basis of the browser you need to support, your best bet can be to use the CSS to match the end of the ID within a querySelector method: < / P>

  document.querySelector ('[id $ = "txtSendSummaryValidEmail"]'). InnerText = "";    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -