开发者

textfield with link

开发者 https://www.devze.com 2023-01-18 21:19 出处:网络
as I can get my textfield displays the contents as <a>? items: [{ 开发者_开发百科xtype: \'textfield\',

as I can get my textfield displays the contents as <a>?

items: [{
开发者_开发百科  xtype: 'textfield',
  value: '<a href="www.google.com"> www.google.com </a>' <--
}]


No, you can not do that with textfield or textarea. If you only want the link, the following works:

                    fieldLabel: 'Attention',
                html: '<a href="http://google.com">xxxxxxxxxxx</a>',


With pure javascript, you can do something like this:

HTML

<label for="txt">Text</label>
<input id="txt" type="text" onclick="url=document.getElementById('txt').value;if (url != ''){window.location=url;}"/>

CSS

input#txt {
    color: blue;
    text-decoration: underline;
}

Find it here

0

精彩评论

暂无评论...
验证码 换一张
取 消