You are not logged in.
Pages: 1
(previously using htmlarea, now in Xinha)
I have a couple of text areas I need to set up that are one line only. I have found the configs for setting height, and have tried using either:
xinha_config.height = '40px';
or
xinha_editors.txtKeyword.config.height = '20px';
without success. It seems that I can control the height of the textarea down to perhaps 200px, but anything lower than that is ineffective.
We need this because in our app users can submit keywords formatted to scientific standards, but if we give them too much space they add all the keywords at once rather than one at a time. We need a small space to convey the point that they should only enter a little information. They never read the instructions we provide
Offline
No suggestions on this? Is there a minimum height set somewhere in the .js?
Offline
Sorry I can't answer your question, but why is Xinha needed for a list of keywords?
I recommend just a regular text box, or an input box (which is a single line tall)...
Last edited by Mr. Picklesworth (2006-12-23 02:14:07)
Offline
Sometimes keywords are not simple alphanumerics. Sometimes italics are "proper" and lack of them makes the keyword "wrong", as in a genus/species. Sometimes the "keyword" is a chemical notation that needs super- or sub-scripts. Sometimes the "keyword" contains greek or mathematical characters. But they are being displayed in HTML, and sometimes the submitter doesn't know HTML, and it is necessary to provide them with tools to format the keyword appropriately. That's where Xinha steps in...
Thanks for asking. I really hope someone can help with this.
Offline
I took another shot at this over the holiday.
This appears to be a browser compatibility issue. Switching to IE, I am able to control precisely the height of the text area, including making it so small it's unusable. I settled on a size of 90px, which makes it large enough to accomodate the minimal buttons and toolbar I need.
However there's still a problem with Firefox, which is my preferred dev browser and is widely used by my target audience.
The config lines I'm using are:
xinha_editors.txtTitle.config.height = '90px';
xinha_editors.txtAbstract.config.height = '300px';
I've tried both with and without the px at the end with the same results.
Help?
Last edited by bronto (2007-01-02 01:12:14)
Offline
I agree with Mr. Picklesworth, if you need italics for valid, and normal for invalid then how about some creative use of the inline editing in Script.aculo.us? It could be done in such a way that typing a keyword then uses an xmlhttprequest to validate it, and then creates the next input box for a keyword to be entered into?
David G. Paul
[url]http://www.newearthonline.co.uk[/url]
Offline
Interesting idea, I've not used script.aculo.us yet, although I've looked at some other things based on prototype. I just looked there, and don't see anything that looks related to what you're talking about. Can you give me a more obvious hint? Point me to an example?
Thanks.
Offline
I'm thinking that attaching an onblur event to the initial input box (or all of them if there are all ready keywords) that uses a function. If using Script.aculo.us you don't have to worry too much about how xmlhttprequest works and can just use there functions that are provided as an interface to it.
Use Ajax.Request (see http://wiki.script.aculo.us/scriptaculo … x.Request) to validate the keyword, and to return some sort of flag like 1 for valid and 0 for failed. Then in the onSuccess: part of the request you can specify another function that will create the next new input box, after having changing the style of the one just edited.
The inline editing can be attached, by following the example: http://wiki.script.aculo.us/scriptaculo … aceEditing
David G. Paul
[url]http://www.newearthonline.co.uk[/url]
Offline
So the inplaceediting will allow my users to format their keyword instead of with Xinha? I can't find an demo of inplaceediting at script.acul.us. Lot's of docs, no demos...
Offline
Aaaah, I thought from your genus example that you meant they were restyled based upon their validity; in that case it wouldn't work with the in place editing (but there's no harm in just using contenteditable tag).
David G. Paul
[url]http://www.newearthonline.co.uk[/url]
Offline
Two versions of each keyword are stored; one for display and one in plain text that's searchable. When the formatted "display" one is submitted I strip tags and store it as the searchable one. The display one needs to be formatable by the user, and a large number of our users can't do that right manually placing html tags. They need something "Word-like" and Xinha fits the bill perfectly, except in Firefox I can't make the text area small enough like I could in htmlArea.
I'm thinking that since this is a browser issue it's something to do with the css used by Xinha. But I can't see what the problem actually is there.
Offline
I take that it's not possible to make the height of the editor any smaller than default? experiencing exactly the same issues as OP.
Offline
Pages: 1