View Full Version : <a> tag in ext forms
programmer@blore
5 Oct 2007, 1:51 AM
Hi,
Can anyone help me out using an example to show how do we use <a href=""></a> tag in the ext forms.
Thanks in advance.
These links might help:
MiscField (http://extjs.com/forum/showthread.php?t=6930)
How to add plain html to forms (http://extjs.com/forum/showthread.php?t=11153)
I've used MiscField for links as follows:
var loginForm = new Ext.form.Form({});
loginForm.add(
new Ext.form.TextField({fieldLabel: 'Username', name: 'username', width: 160, allowBlank: true}),
new Ext.form.TextField({fieldLabel: 'Password', name: 'password', width: 160, allowBlank: true, inputType: 'password'}),
new Ext.form.MiscField({fieldLabel: ' ', labelStyle: 'display:none;', labelWidth: 0, id: 'mailtoSupport', width: 160, value: '<a href="mailto:support@acme.com">Forgot your password?</a>'})
);
programmer@blore
5 Oct 2007, 2:34 AM
Hi,
Thanks a lot for ur quick reply but when I use the piece of code given in ur reply in my program i get 'object expected ' JS error on the IE browser.We are using ext1.1.1 and Ext.form.MiscField is not defined anywhere. Where can i find the definition for Ext.form.MiscField.
These links might help:
MiscField (http://extjs.com/forum/showthread.php?t=6930)
How to add plain html to forms (http://extjs.com/forum/showthread.php?t=11153)
I've used MiscField for links as follows:
var loginForm = new Ext.form.Form({});
loginForm.add(
new Ext.form.TextField({fieldLabel: 'Username', name: 'username', width: 160, allowBlank: true}),
new Ext.form.TextField({fieldLabel: 'Password', name: 'password', width: 160, allowBlank: true, inputType: 'password'}),
new Ext.form.MiscField({fieldLabel: ' ', labelStyle: 'display:none;', labelWidth: 0, id: 'mailtoSupport', width: 160, value: '<a href="mailto:support@acme.com">Forgot your password?</a>'})
);
Sorry, I should've been clearer - MiscField isn't a part of ExtJS, it's a User Extension. If you follow the link (http://extjs.com/forum/showthread.php?t=6930), copy the code into your own Ext.MiscField.js file, add the CSS to an extensions.css file (or whatever you want to call it), and include these at the top of your HTML page.
This is how mine is set up:
<link rel="stylesheet" type="text/css" href="../css/extensions.css" />
<script type="text/javascript" src="../misc/Ext.MiscField.js"></script>
Note: I'm using 1.0.1a, but it shouldn't be a problem in 1.1.1.
programmer@blore
5 Oct 2007, 3:52 AM
Thanks a lot! It worked for me.
:)
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.