Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

css jquery hide tr

I can't get jquery to select my TR and make it disappear, or even put a border around it.

Here is the tr I am trying to get a handle on:
<tr id="ctl00_PlaceHolderMain_ifsSendEmail">
                  <td valign="top" class="ms-descriptiontext">


This doesn't work:
$("tr#ctl00_PlaceHolderMain_ifsSendEmail")
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

To hide the row this is a working sample http://jsbin.com/ezugok/1/edit of the code below

$(document).ready(function() {
 $('tr#ctl00_PlaceHolderMain_ifsSendEmail').hide();
});

Open in new window

Avatar of jackjohnson44
jackjohnson44

ASKER

Thanks.

Sorry, I didn't phrase that well.  For some reason, the selector that you and I tried will not select the TR.   The code you posted will not work.  I am testing using firebug.

It looks to me that it should work, but it just won't.  If I do
$('tr#ctl00_PlaceHolderMain_ifsSendEmail').size(), I get 0
If you click on the link I sent you it works perfectly.  If it does not work with your page, then you have an error some place on your page.
This is also in a SharePoint popup, but I didn't think that would be an issue.
Thanks, that is why I am asking.
You could be creating the row after document.ready and that could be the reason you have 0 length after selection. You could use just css to do the same that way it will be always hidden and you will show the row only if you need it.

#ctl00_PlaceHolderMain_ifsSendEmail {
    display:none
}

Open in new window

Let's focus on the question you asked.

>I can't get jquery to select my TR and make it disappear

You will use the .hide() command.  In this case to target your given id it is

$('tr#ctl00_PlaceHolderMain_ifsSendEmail').hide();
Why would I focus on statement that I made when I misspoke then admitted to?  I'd like to move on.   Please do not respond to this again. I am not looking for an argument.  I apologize for wasting your time.
Do you have a live URL?
Unfortunately no.  If you have access to SharePoint and can open the dialogue to grant user permissions, I am trying to remove the area with a checkbox saying send welcome email to new user.
Unfortunately I don't have access to a SharePoint site. My guess though would be that there maybe some other js that is either overriding or nullifying your jQuery.
I believe that the issue is the dialogue is inside an iframe.  I don't have any control over how this appears or works.
Hi,
as I assume you refer to your other question with the send email area, can you ensure that jQuery is loaded correctly?
I did the following:
In the PlaceHolderAdditionalPageHead add a reference to your jQuery library. Then add a Javascript block with a function:
function HideEmailRow() {
jQuery("tr#ctl00_PlaceHolderMain_ifsSendEmail").hide(); 
}

Open in new window

Then search for the function
_spBodyOnLoad()
and add a call to your created function:
HideEmailRow();

This works on my dev server.
HTH
Rainer
I'm not arguing. Please don't be offended. In order for us to help you, you can see it is important to get all the facts out as we can't read your mind.     I would suggest closing out this question and create a new one building on what you know.
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just hide the row with css.
Thanks RainerJ,

In case anyone else has this issue, if you are using FireBug and trying to execute javasript from the console window, you need to point to the iframe.  If you are calling from the master page like the example above, it will work.

from the
$(".ms-dlgFrame").contents().find("#ctl00_PlaceHolderMain_ifsSendEmail").hide();