Click here to Skip to main content
15,890,438 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Re-Developing asp.net webform to MVC Pin
hussain.attiya23-Nov-16 20:27
hussain.attiya23-Nov-16 20:27 
QuestionWeb API integration into MVC Pin
sunsher17-Nov-16 16:55
sunsher17-Nov-16 16:55 
AnswerRe: Web API integration into MVC Pin
Matt U.19-Nov-16 5:39
Matt U.19-Nov-16 5:39 
AnswerRe: Web API integration into MVC Pin
Afzaal Ahmad Zeeshan24-Nov-16 2:36
professionalAfzaal Ahmad Zeeshan24-Nov-16 2:36 
Questiondatapager field(s) produce error I can't solve Pin
Scott5217-Nov-16 4:05
Scott5217-Nov-16 4:05 
AnswerRe: datapager field(s) produce error I can't solve Pin
Richard Deeming17-Nov-16 4:38
mveRichard Deeming17-Nov-16 4:38 
GeneralRe: datapager field(s) produce error I can't solve Pin
Scott5217-Nov-16 4:45
Scott5217-Nov-16 4:45 
QuestionLimit Date Ranges to be not picked up which are already exists in the list Pin
indian14316-Nov-16 13:37
indian14316-Nov-16 13:37 
Hi All,

I have Date pickers that are used in date range list, I am using jQuery function to add those selected Data ranges to the list
, now, as user can select the new date range which falls under the same date range that is already selected.

So I want to limit the user from not able to select the date range which is already in the selected date range list. Here is the code I am using the to add the Date ranges to the list, any help
a code snippet, a link or even a suggestion helps me great.
var onStartDateSelect = function (dateText) {
    $(this).trigger("input");

    if (typeof me.values[daterangeindex] === 'undefined')
        me.values[daterangeindex] = {};

    fullDateString = $(this).val() + "," + $(this).next().val();

    $(this).next().datepicker('option', 'minDate', new Date($(this).val()));

    if (fullDateString.length == 21) {

        me.values[daterangeindex] = ";" + fullDateString;
        daterangeindex++;

        var str = fullDateString.replace(/[_\W]+/g, "");
        var $wrapper = $(this).parent().parent();

        addNewDate($wrapper);
    };
};

var onEndDateSelect = function (dateText) {
    $(this).trigger("input");

    if (typeof me.values[daterangeindex] === 'undefined')
        me.values[daterangeindex] = {};

    fullDateString = $(this).prev().val() + "," + $(this).val();

    $(this).prev().datepicker('option', 'maxDate', new Date($(this).val()));

    maxStartDate = $(this).val();

    if (fullDateString.length == 21) {
        me.values[daterangeindex] = fullDateString + ";";

        daterangeindex++;

        var $wrapper = $(this).parent().parent(); //$('.parameterFieldResize.parameterField');
        addNewDate($wrapper);
    };
};

var onRemoveClick = function () {
    if (lastDateRangeDivId != $(this).parent().attr('id')) {
        $(this).parent().remove();
    }
};

var addNewDate = function ($wrapper) {
    count++;
    var tmpHTML = '<div class="parameterFieldResize parameterField" style="width: 160;" id="' + paramName + '_1_Div' + count + '">' +
       '<input class="parameterDateRangePicker clearable start" style="width:70px" placeholder="Start" type="text" name="' + paramName + '_1_StartDate' + count + '" id="' + paramName + '_1_Start' + count + '"  />' +
       '<input class="parameterDateRangePicker clearable end" style="width:70px" placeholder="End" type="text" name="' + paramName + '_1_EndDate' + count + '" id="' + paramName + '_1_End' + count + '"  />' +
       '<button type="button" style="height:3px; width:1px;text-align: center;vertical-align:middle;background: gray;" id="' + paramName + '_1_Remove' + count + '" class="remove-field"></button>' +
     '</div>';

    var $newField = $(tmpHTML).appendTo($wrapper);

    lastDateRangeDivId = paramName + "_1_Div" + count;

    $newField.find('.parameterDateRangePicker.clearable.start').datepicker({
        changeMonth: true,
        changeYear: true,<br />
        onSelect: onStartDateSelect
    });

    $newField.find('.parameterDateRangePicker.clearable.end').datepicker({
        changeMonth: true,
        changeYear: true,<br />
        onSelect: onEndDateSelect
    });

    $newField.find('.remove-field').on({
        click: onRemoveClick
    });
};
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."


modified 17-Nov-16 10:47am.

QuestionTrying to set fixed width with stringbuilder is not working correctly. Pin
samflex15-Nov-16 3:57
samflex15-Nov-16 3:57 
QuestionBest approach to avoid confusion in Configuration file when deploying an ASP.Net MVC application Pin
indian14314-Nov-16 13:48
indian14314-Nov-16 13:48 
AnswerRe: Best approach to avoid confusion in Configuration file when deploying an ASP.Net MVC application Pin
Nathan Minier15-Nov-16 1:33
professionalNathan Minier15-Nov-16 1:33 
GeneralRe: Best approach to avoid confusion in Configuration file when deploying an ASP.Net MVC application Pin
indian14315-Nov-16 5:54
indian14315-Nov-16 5:54 
AnswerRe: Best approach to avoid confusion in Configuration file when deploying an ASP.Net MVC application Pin
Richard Deeming15-Nov-16 2:21
mveRichard Deeming15-Nov-16 2:21 
AnswerRe: Best approach to avoid confusion in Configuration file when deploying an ASP.Net MVC application Pin
Dominic Burford17-Nov-16 2:41
professionalDominic Burford17-Nov-16 2:41 
QuestionNeed help with validation on image links Pin
Bootzilla3314-Nov-16 8:56
Bootzilla3314-Nov-16 8:56 
QuestionAssign a javascript or jQuery method to a button onClick event Pin
indian14314-Nov-16 6:24
indian14314-Nov-16 6:24 
AnswerRe: Assign a javascript or jQuery method to a button onClick event - Resolved Pin
indian14314-Nov-16 6:27
indian14314-Nov-16 6:27 
Questionhow to bind two dropdownlists using jquery,C# from backend Pin
Member 1284531611-Nov-16 1:49
Member 1284531611-Nov-16 1:49 
Rant[REPOST] how to bind two dropdownlists using jquery,C# from backend Pin
Richard Deeming11-Nov-16 2:04
mveRichard Deeming11-Nov-16 2:04 
QuestionThe datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
indian1439-Nov-16 13:19
indian1439-Nov-16 13:19 
AnswerRe: The datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
Richard Deeming10-Nov-16 2:13
mveRichard Deeming10-Nov-16 2:13 
GeneralRe: The datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
indian14310-Nov-16 5:53
indian14310-Nov-16 5:53 
GeneralRe: The datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
Richard Deeming10-Nov-16 5:58
mveRichard Deeming10-Nov-16 5:58 
GeneralRe: The datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
indian14310-Nov-16 6:30
indian14310-Nov-16 6:30 
GeneralRe: The datepicker input items that are added at runtime using Jquery are not firing the datepicker event Pin
Richard Deeming10-Nov-16 6:48
mveRichard Deeming10-Nov-16 6:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.