Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I current have a list of items being pulled through in a Content Query Web Part.

Onload, I would like to display the items from today onwards, and for this to be a radio button selected onload.

The other radio button option is to display items from yesterday backwards.

Using jQuery, how could i define this approach?

Thanks!

<div id="filter-items-view">
<input id="upcoming-radio" type="radio" name="Upcoming">Upcoming</input>
<input id="recent-radio" type="radio" name="Recent">Recent</input>

I'm stuck on two things. The first being how to click a radio button on and off (i have two, that when click, they are both selected, probably due to the fact the jquery isn't assisting) and the second being the attribute used to define the items greater than and less than today.

share|improve this question

1 Answer

you can check this out, as explained use Div elements that you can then show/hide from the radio button selection :)

$(document).ready(function() {
    $("input[name$='from']").click(function() {
        var test = $(this).val();
        $("div.desc").hide();
        $("#c" + test).show();
    });
});
</script>

http://stackoverflow.com/questions/7968555/radio-button-hide-and-show-form-content

hope it helps :)

share|improve this answer
Thanks for the response! I've added some code into the original post. I have a CQWP that's displaying all items. When clicking recent, I want all previous items before today to show and hide everything else. When clicking upcoming, I want everything from today forward to show.. – Tron Jan 18 at 9:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.