[Project_owners] xul textbox

Eric H. Jung eric.jung at yahoo.com
Thu Feb 14 11:47:10 PST 2008


As Neil suggests, you could do:

<textbox id="tb" onkeypress="styleInput(this);"/>

<script>
function styleInput(tb) {
  tb.setStyle(tb.value == "special input" ?
    "font-weight: bold;" : "font-weight: normal; font-style: italic;");
  // you could also use tb.setStyle() or tb.className = myClass
    
}
</script>
--- Ondrej Donek <ondrejd at gmail.com> wrote:


---------------------------------
  The best (as I think) is to use XBL - I did oncetime something similiar(but highlighted words
were loaded from sqlite database) but I haven'tthat code here so I couldn't post it :( - I'll try
to send it tommorrow.

Neil wrote:  
joe ertaba wrote:  
      
I want to have a textbox which when some especial text typed in it become bold otherwise be
italic;non-bold    
    
You could use some script to change the style of the textbox depending on the text typed into
it._______________________________________________Project_owners mailing
listProject_owners at mozdev.orghttps://www.mozdev.org/mailman/listinfo/project_owners  

> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
> 



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



More information about the Project_owners mailing list