On Wed, Feb 23, 2011 at 10:16 PM, Chanaka Jayasena <chan...@wso2.com> wrote:
> Hi all, > > During recent UI reviews, introducing default text for text boxes, > which disappears with user interaction was suggested. > > I added this to UI core. To add this functionality to any text box follow > the three steps below. > > 1.- Import the following two js files in to the jsp file. > > <script src="../yui/build/yahoo-dom-event/yahoo-dom-event.js" > type="text/javascript"></script> > <script src="../admin/js/widgets.js" type="text/javascript"></script> > You can include this into the header.jsp, so that it automatically becomes available for everyone. > > 2 - Make sure alt, id, value attributes are present and they are defined as > follows.( Alt tag holds the default text value for that particular field. > Value tag is required and it can initially be empty or it can hold a value.) > > ex: <input type="text" id="txtBoxId" alt="Enter Name" value="" /> > > 3 - Call this js method to put every things in to action. > > giveDefaultText("txtBoxId"); > When you click on the text box, does the default text disappear. Also, can we define our own input type; e.g. <input type="smarttext" ... /> ? In other words, our own widget. Calling that Javascript method is cumbersome. > > thanks, > Chanaka > > _______________________________________________ > Carbon-dev mailing list > Carbon-dev@wso2.org > http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev > > -- *Afkham Azeez* Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com, * * *Member; Apache Software Foundation; **http://www.apache.org/*<http://www.apache.org/> * email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919 blog: **http://blog.afkham.org* <http://blog.afkham.org>* twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez> * linked-in: **http://lk.linkedin.com/in/afkhamazeez* * * *Lean . Enterprise . Middleware*
_______________________________________________ Carbon-dev mailing list Carbon-dev@wso2.org http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev