I use CKEditor and bPopUp jQuery plugin, if i set CKEditor just in html, without other scripts it work fine, but when i try set it into popuped window they stop working, i see just CKEditor but cant do anything, cant click for typing text, when click on buttons get errors in console. Mby somebody know is it real to fix ? I have an example here: http://kxc.lv/CKEditor_problem/
How you see, it's correctly work without popup, on start, but if click on "click me" you get popup with buggy CKEditor, and it's not cause i have two textarea with same id on a page, if i rempove first textarea without popup, it;s still dont work.
Mby somebody can help me please ?
In your DOM, all of your id="" must be unique. Change the second to id="editor2" and you should be fine.
Related
I have an ASP button that when clicked brings up a window.confirm. This window.confirm disappears without user interaction. However, if I keep clicking the ASP button, after about the 4th or 5th click the window.confirm box will work as expected.
A couple of things that I also noticed, after hours of working on it, if I remove the Text property from the ASP button, the window.confirm works as it should.
This made me think, "Hmmmm... let me look at the <input> button that is behind the scenes of the ASP button, and I noticed that if I remove the value from the input the window.confirm works, but if I put a value in the input, the window.confirm stops working again.
Does anyone know what may cause this? Is there a work around to putting text in the button without using the Text property? I haven't tried innerHTML yet because I wanted to see if there is anything else I can do before I do that.
Btw, I tried using OnClientClick, instead of OnClick and I get the same results.
Here is the code that I have for the button:
<asp:Button ID="btSubmit" runat="server" Text ="Submit Email" OnClick="btSubmit_Click" OnClientClick="return confirm('Test');"/>
I've just faced the same issue.
As investigating the problem I've found out that the code itself is ok, but after puting it in the context of the website - starts failing as described above.
The problem seems to be the facebook tracking code called through GTM.
If I remove the whole Google Tag manager code from the header - everything just works fine
Although it's not the sollution yet, so I'll need some deeper GTM investigation to prevent this behaviour. But this also might help you...
I try to focus an element of an email field in this webpage, with the following code:
document.querySelector("#user_email").focus();
While manual focusing with either clicking on the field with the mouse or using tab works, the focus() method fails to create the focus, as it seems both from the fact the CSS doesn't change, and the console returns "undefined".
As a newcomer, I ask why?
When you're calling focus() from console, focusing won't happen immediately - you have to go back to the site (close console). When you go back from console to a website by clicking on a website, focusing won't happen. Close console using shortcuts or use setTimeout to delay focusing to give you time to go back to the website.
Digital Ocean's input boxes are focusing fine for me. The undefined basically means that nothing is returned from your expression. For example if you type var a = 123 it'll still say undefined. Also there is no special CSS styling on these input boxes. You might be getting confused with the ones in their control panel.
UPDATE: OP was getting confused with Chromes default input styling.
You should try with document.getElementById('user_email').
document.getElementById('user_email').focus() ;
<input id="user_email">
Im using Selenium to open a page. After I open the page, I want to click a some sort of refresh button. When I click it, Im getting this error:
ElementNotVisibleError: element not visible
This is the code I use to click the button:
driver.findElement(By.id(id)).click();
My guess is that the button goes not visible whenever it is pushed. And that maybe it starts off not visible as well. Cause it doesnt do a full page refresh.
Any way for selenium to check if something is visible, and maybe wait until it is?
Edit:
As it turns out, there are multiple buttons with the same ID. And the button I am trying to reach are way down. I tried to find the button with By.xpath, but I still couldnt find it. The way I did it, was to search for button by id, like this //button[contains(#id, 'abc')][1]. (Different number of course).
Selenium could not find the element, but I could find it with Chrome developer tools. Any suggestions?
Solution: 1 You can try using this code in a syso,
System.out.println("getting Page Source "+driver.getPageSource());
This method will return the entire page Source and you can check whether your button exists in the source or not. You can place the above code at several points in your function and check until you find the button in the source.
Solution: 2 In case your button does not exist in the source you will have to check and see whether the button is getting loaded in an iframe and if so you can use the following code and switch to the iframe and and then try finding the button,
driver.switchTo.frame(frameName);
In your case you could use Explicit wait to check when the element/button is clickable.
Try doing this
wait.until(ExpectedConditions.visibilityOfElementLocated(id))
I'm running into an issue where I have a button on my page that has a CKEditor.
When the button is pressed I want to append text to the editor.
I used the following code:
$('#mtxDescription').append($(this).data('key'));
CKEDITOR.instances['mtxDescription'].updateElement();
However this does not work. The editor does not reflect the change. However when I inspect the editor I find that the textarea does show the appropriate text appended, its just the editor is not showing it. Does anyone know of a way to get around this. Also, just in case anyone is wondering, I do have the jquery CKEditor adaptor script referenced in my page.
Also, if a somewhat related, but separate issue.
I have a drop down list that will allow the user to toggle between the text area shown on the page being the CKEDitor WIZIWIG and going back to being a normal textarea again. However I can't seem to do this without literally refreshing the page, I want to do it through javascript/jquery so I don't have to refresh the page whenever the change the dropdown selection. I've already tried the built in destroy method. It doesn't seem to do anything visually, the editor does not revert back to a simple textarea.
Just in case you were going to ask for some more code, here is what my HTML page looks like:
<textarea id="mtxDescription" name="mtxDescription"></textarea>
Here is how I initialize the editor
CKEDITOR.replace('mtxDescription', {
sharedSpaces: { top: 'ed-top'}
});
I was able to solve this problem by using the following code instead of using jQuery CKEDITOR.instances.mtxDescription.insertHtml($(this).data('key')) I still need a way to remove the editor at runtime.
I want to prevent TinyMCE disabling gecko spellcheck. I've added gecko_spellcheck : true to config. It works fine, but when I type a new paragraph all highlights of previous paragraph are gone. Some illustrations:
When I make right click on textarea and disable/enable spellchecking, all of errors are highlighted. How can I make TinyMCE always to highlight errors?
This is a problem that can be resolved.
If you reset the tinymce iframe body everything that is spelled incorrectly gets underlined.
You may use this ed.getBody.innerHTML = ed.getBody.innerHTML; to make it work.