Click here to Skip to main content
15,921,694 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, I really didn't know how to explain myself better in the title, but what I want is to be able to make a code that for example when choosing 2 dates on a form are checked immediately if one is before the other and if not then it sends an alert... I know how to do the code I just don't know how to call it in ember

UPDATE:

C#
$(document).ready(function () {
    var event = new Date();
    var arrival = new Date();
    var departure = new Date();
    var departureFlight = new Date();
    var returnFlight = new Date();

    event = $('#inputEventStart').data('date');
    arrival = $('#inputArrival').data('date');
    departure = $('#inputDeparture').data('date');
    departureFlight = $('#inputFlDeparture').data('date');
    returnFlight = $('#inputFlReturn').data('date');

    if (arrival < event) {
        alert("Arrival date must be after the event!");
        sender._textbox.set_Value('');
    }
    if (departure > event) {
        alert("Departure date must be before the event!");
        sender._textbox.set_Value('');
    }
    if (returnFlight < departureFlight) {
        alert("Return flight must be after flight departure");
        sender._textbox.set_Value('')
    }
});



I have this code, what happens is it will only work if I refresh browser and I want it to work without having to refresh it
Posted
Updated 11-Feb-15 0:04am
v2
Comments
Kornfeld Eliyahu Peter 11-Feb-15 5:19am    
ember.js is JavaScript as any other JavaScript...So it is not clear what is your problem...
You may show us a sample to make it better...
varmartins 11-Feb-15 6:03am    
I know ember is JS, so I'll improve the question so you can understand better

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900