#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Posts
    31
    Rep Power
    7

    Hope this is in the right area... NicEdit.js - Textarea's showing up incorrectly


    Hi all,

    I am trying to figure out what is causing an issue with textareas on my pages that use nicEdit.js to allow features for editing text.

    The problem is, the textareas no longer have a white background when they're shown with nicEdit.js. Instead, the background image from the page itself is showing inside the textareas. This is making it difficult to type in them. I would greatly prefer to have the standard white background, not a transparent box.

    If anyone knows nicEdit.js, and how I could achieve this, please let me know.

    Thanks in advance!
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,930
    Rep Power
    1045
    Hi,

    open the developer tools of your browser (F12 in Chrome) and check the HTML generated by NicEdit.

    NicEdit doesn't display the textarea at all. It uses its own div with the class nicEdit-main. So that's what you wanna edit. Apart from the background color, you also have to replace the margin with padding. Otherwise, the margin will still have the background of the page.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Posts
    31
    Rep Power
    7
    Originally Posted by Jacques1
    Hi,

    open the developer tools of your browser (F12 in Chrome) and check the HTML generated by NicEdit.

    NicEdit doesn't display the textarea at all. It uses its own div with the class nicEdit-main. So that's what you wanna edit. Apart from the background color, you also have to replace the margin with padding. Otherwise, the margin will still have the background of the page.
    I have tried multiple ways of doing that. I have tried adding #nicEdit-main to my css specifying background-image:none as well as finding the reference to nicEdit-main in the nicEdit.js file, which only had margin specified, so I added background-image:none; to that as well. Nothing seems to work.

    Getting frustrated with this.
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,930
    Rep Power
    1045
    nicEdit-main is a class, not an id (like I said above). So your CSS rule must be
    Code:
    .nicEdit-main {
    	background-color: white;
    	margin: 0 !important;
    	padding: 4px;
    }
    Turning the margin off in the js file is of course more elegant than "!important".
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2007
    Posts
    31
    Rep Power
    7
    Thank you! And sorry for the silly mistake. Going on 28 hours no sleep here trying to get this finished. I appreciate your effort!

IMN logo majestic logo threadwatch logo seochat tools logo