PDA

View Full Version : textfield with place holder and icon



sandy52
30 Jan 2014, 9:27 PM
Hi,
I need help i want add icon and place holder into textfield how can i do that like eg :
47753
how can i do this in code.

Thanks.

Regards,
Sandeep K Tathe

Farish
31 Jan 2014, 12:30 AM
putting the text is simple. you can use the emptyText config:


{
xtype: 'textfield',
fieldLabel: 'Name',
emptyText: 'Enter your name'
}i dont know

how to place an image/icon in there...

palakurthivishal
31 Jan 2014, 1:45 AM
Hello sandy52,
Try this way, it worked for me.


{
xtype : 'textfield',
fieldCls : 'test'
}

.test {
padding : 20px;
background-image : url('./images/yourIcon.png') no-repeat;
}

sandy52
2 Feb 2014, 7:53 PM
Both of your suggestion work thanks B)