How to completely change the css position of an element on the page to appear in another part of the document flow? - forms

I have a long form with text inputs, and in the middle of it, I'd like to insert a jquery upload (blueimp) file plugin which uses a form element. I know that nested forms are not valid markup. How can I use CSS to visually position a form element inside another form element without doing some messy absolute positioning?

It seems like using an iframe to generate the content, and then inserting the iframe into the middle of the original form works quite well. I'm unfamiliar with the caveats of iframes but everything seems to work fine.

Related

Some links displayed as text in TYPO3

I have added links to a list of sentences in my TYPO3 backend.
In the frontend, some of these sentences are rendered properly, with a link to them. However, some others are rendered as plain text, with the tag visible.
View of the text in the backend
View of the rendered text in the frontend
What caused the problem, and how can I correct it?
your description of the error is not good enough to give a good answer. please explain more in detail what you are doing: templates, configuration, ...
for the moment I guess: you use fluid-templates and have fluid-variables which contain the rendered content.
instead of outputting the content of a field directly (like {fieldname}), where the rendering is done by fluid you need to output the already rendered output without interfering of fluid (rtefieldname->f:format.raw()}) as for RTE-fields the content is already rendered in html. otherwise all specialchars are converted to show as given.
It might be that the <a> tags aren't closed properly.
Try checking the HTML code from the backend (by clicking the <> button in the backend). See if the </a> tag is where it should be, at the end of each sentences.
You need to find the difference between the lines that work and the lines that don't.

Angular UI Bootstrap typeahead does not extend past parent div border like a normal select dropdown

I'm using the Angular UI Bootstrap typeahead to display a customized list of suggestions as the user types into a text input form control. This form control exists inside a div using jQuery slimScroll in order to maintain a constant div size despite the size of its contents fluctuating. I really hoped the typeahead would display over everything like a regular html select dropdown, but unfortunately it does not, as can be seen in this plunker. I've tried futzing around with the z-index and adjusting the position and display properties; all fruitless endeavors.
Does anybody know how to get the typeahead popup to display over its parent border? If not, is there a way I could coerce the select tag to display HTML content so I can include glyphicons, emphasized text, etc. in the list of suggestions?
The problem is with the slim scroll - you are inside a div with relative position and overflow hidden (think of it as an iFrame). There is a small workaround...
You could, essentially set the position of the generated UL (.dropdown-menu) to fixed, set a height for it, then set an overflow:scroll...
It would work in some scenarios where the input field has a fixed position... otherwise you'd need to control where the input is and adjust the position of the auto-complete to follow, and a whole other bunch of nasty scripts.
Without looking at your application, I cannot understand why your have this particular architecture, but I can say that there must be cleaner options for handling autocomplete outside of slimscroll.
I just set typeahead-append-to-body="true" on the typeahead control and it worked. Not sure exactly why, but it's certainly a simple solution.

Non Editable element in TinyMCE (related to Mathjax)

I'm building an extended editor around TinyMCE and I have to implement a Math formula module. I've choosen Mathjax for formula rendering, using plain html/css. So far, I've managed to create a plugin that popup a panel with a textarea, you can enter your latex in, there's a preview in the panel.
Once you validate the formula, it's injected into tinymce content. This new content is A LOT of spans with inlined styles, and OF COURSE, I don't want tinymce to be able to edit that directly. (sidenote: we only store latex, not the rendered html output from mathjax)
Basically, I want that a piece of html inside Tinymce to be ignored totally, but displayed in place. I want my carret to be able to move before that piece of html, and after, but not inside.
The "non editable content" plugin seems to be close of what I'm looking for, but it has some limitation (you can't ADD no editable content on the fly, having nested html content inside an element flagged as "non editable" broke some things, etc.)
Is someone could help with that ? I started to tweak the non editable plugin, but it's really really hard to understand existing code. Has someone already did something like that, or is there another third party plugin ?
thanks

tinyMCE - point between block elements

I am using tinyMCE in show block elements mode.
I have written custom plugin that inserts prepared html blocks (layout partials) in actual cursor position.
It's problematic to point a space between two divs.
If I have markup like that:
<div id="first"></div><div id="second"></div>
When I click beteween those divs I would land in first or second div, never between.
So I try to edit html source and result in markup whit br's:
<div id="first"></div><br/><div id="second"></div>
Now I can point between those divs, but it does not work with elements that I add dynamically via tinyMCE. If I add partial eg.
<div></div><br/>
clicking after that div is not posibble. But it's posibble when I edit source manually. Weird. Do you have any solution at this subject?
Tinymce takes care that the user is not able to click between div or p tags.
The reason for this is easy: If a user could click inbetween and he would type in a letter - then there would be another div or p created containing that letter. This is not the way rtes are designed to work. If you want to insert somthing between two divs you will need to use a special button or own plugin to take care of this, but placing the cursor where you won't it to be by hand won't work.

need to style input from a form with css in real time

Ok im struggling to find anything on this as im probably searching the wrong keywords.
I have a backed form thats use to display content on a page. When entering the details i want to be able to use a basic text editor to style the text, like bold, bullets, underline.
On top of that i would also like to allow them to wrap section in paragraph tabs, apply a certain style i.e style id="x".
Its more for backend so it doesnt have to be really user friendly but if there was an uncomplicated way of showing the styles in the form as i apply them, basically a WYSIWYG view. If not i will settle for applying the styles without having to see all the hmtl and css tags in the editor but when the information is passed via the INSERT query it will show pass all the relevant code like My Style and so on.
Now im quite happy to spend the time learning how to do this if you point me in the right direction but i have no idea what keywords to search. Ideally if there is a script out there i can just edit to my needs would be great too rather than starting from scratch.
Finally since im learning php and mysql still keeping it dumbed down will help and also since my values im passing is going to be full of characters the code wont like what functions should i look up to pass the code and content into the database to avoid breaking the code
I'm not entirely sure what you mean, but it seems you can achieve what you want using an editor like for example TinyMCE in combination with JQuery?
With JQuery you can show/hide items and ander your css like
$("p").mouseover(function () {
$(this).css("color","red");
});