Ticket #276 (new enhancement)

Opened 4 years ago

Last modified 3 years ago

Add border to <form> elements.

Reported by: PoeuffF Owned by: anonymous
Priority: low Milestone: 2.0
Component: Xinha Core Version:
Severity: normal Keywords: form border
Cc:

Description

I'm developping a form's plugin like fckeditor.

With this plugin you can create easily some <form> with <text> <select> <checkbox> ...

i d like to create a visibly area on the editor which allows people to see the limit of <form>

i don't know what function i have to use..

this.editor.insertHTML("<div style=\"border:1px dashed #ff0000;\" ><br><br></div>");

with this code, my area is created but <div ... /div> appear in the code generate by xinha.

So my question is :

What function i have to use to insert visibly HTML ( for my area ) which not appear in the code generate by xinha ?

Change History

Changed 4 years ago by niko

wouldn't do a simple css-rule like

form { border 1px dashed #ff0000; }

do the job too?

see InsertAnchor-plugin for an example.

Changed 4 years ago by gogo

Yes, this is a job for CSS, not inserting stuff into the html.

PS: I'm also working on a panel-based Macromediaish form plugin :)

Changed 4 years ago by wymsy

See also ticket #256 for another forms plugin.

Changed 4 years ago by anonymous

  • owner changed from gogo to anonymous

Changed 4 years ago by anonymous

cbdfdgfdg

Changed 4 years ago by PoeuffF

Very good plugin on ticket #256

thx wymsy

it's that i need !!!

I've tryied with CSS to show the form's area but it doesn't work.

thx 4 your help

Changed 4 years ago by PoeuffF

CSS works for all the page, but when i create a <form> it doesn't work.

Maybe because it's in a <textarea>...

i'm searching

Changed 4 years ago by gogo

It appears to work for me. What CSS are you using, and how are you getting it into Xinha?

Changed 4 years ago by PoeuffF

i put this line :

<style type="text/css">
form { border 1px dashed #ff0000; }
</style>

on my page.php which load plugin.. generate xinha. but doesn't work, i think it's not the good place :/

Changed 4 years ago by gogo

  • keywords form border added
  • severity changed from normal to enhancement
  • summary changed from Form's plugin to Add border to <form> elements.

Yes, you need to give the style to Xinha, not to the page containing Xinha.

xinha_config.pageStyle = 'form { border 1px dashed #ff0000; }'

is what you want.

Setting enhancement, because I may include a style like that by default in the near future.

Changed 4 years ago by PoeuffF

I don't understand why it doesn't work !!

if i try in my init() function:

myeditor = new HTMLArea("ta");
//..
myeditor.config.pageStyle = "form { border 1px dashed #ff0000; }";

or :

xinha_config = new HTMLArea.Config();
xinha_config.pageStyle = "form { border 1px dashed #ff0000; }";

Normally the area would appear but it's not appear :/

what's the best solution and where i have to put this line ?

Changed 4 years ago by gogo

Note there is a colon missing in the CSS (should be "border:"). You should insert this into step 3 of the process as indicated in testbed.html or full_example-body.html (if using that file to base off, best to grab a fresh copy, I just made some minor changes).

Follow the NewbieGuide and you should be right.

Changed 3 years ago by PoeuffF

I've found why it doesn't work !!! LOL

as you can see with my english, i'm not english, i'm french ! lol

so my _editor_lang is "fr" and not "en".

With "en" it works but "fr" not.

So what function i've to add to work in french ?

Changed 3 years ago by PoeuffF

It's not the lang "fr" which cause pb but the plugin FullPage?.

If you load the FullPage?'s plugin the area doesn't appear.

the solution is in the full-page.js :

function FullPage(editor) {
        this.editor = editor;

        var cfg = editor.config;
// COMMENT THIS LINE => cfg.fullPage = true;

Now it works normally in french ("fr") english ("en") and every lang.

Thx for your help.

Changed 3 years ago by gocher

Look at plugin Forms changeset 191, only label and fieldset are missing!

Changed 3 years ago by gogo

  • priority changed from normal to low
  • milestone set to 2.0
Note: See TracTickets for help on using tickets.