Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 11th, 2012  |  syntax: None  |  size: 1.42 KB  |  hits: 7  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. radtextbox validate url
  2. <asp:TextBox runat="server" ID="txtOrigeenHup" CssClass="mycssMascara" Width="390px"
  3.      TextMode="MultiLine" Text='<%# Eval("urlOrigen") %>'
  4.      onfocus="OnFocus(this.id,'http://paginaEjemplo.com')"
  5.      onblur="OnBlur(this.id,'http://paginaEjemplo.com')">http://paginaEjemplo.com asp>
  6.        
  7. function OnFocus(elementId, defaultText) {
  8. if (document.getElementById(elementId).value == defaultText) {
  9.     document.getElementById(elementId).className = "mycssMascara";
  10.     document.getElementById(elementId).value = "";
  11. }}
  12.   function OnBlur(elementId, defaultText) {
  13. var textValue = document.getElementById(elementId).value;
  14.  
  15. if (textValue == defaultText || textValue.length == 0) {
  16.     document.getElementById(elementId).className = "mycssMascara";
  17.     document.getElementById(elementId).value = defaultText;
  18. }
  19. else
  20.     document.getElementById(elementId).className = "mycss";  }
  21.        
  22. .mycssMascara
  23. {
  24.  font-weight: normal; color: #808080; background-color: #FFFFFF; border: 1px solid #C0C0C0; letter-spacing: 0pt; word-spacing: 1pt; font-size: 14px; text-align: left; font-family: arial, helvetica, sans-serif; line-height: 1; margin: 4px; padding: 6px;
  25. }
  26.  
  27. .mycss
  28. { font-weight: normal; color: #000000;  background-color: #FFFFFF; border: 1px solid #C0C0C0; letter-spacing:
  29. 0pt;  word-spacing: 1pt; font-size: 14px; text-align: left; font-family: arial, helvetica, sans-serif; line-height: 1; margin: 4px;  padding: 6px;
  30. }