I have a calendar function, where I would like to call a column from my MySQL database. Before I am making the call for the column, I would just like to check if there is connection at all. My call goes through the servlet dataExchange.java. This servlet works fine, and I can put in information from my JSP page. In my database the format for the date is yyy-dd-mm. Therefore I have changed my JQuery calendar to have that format. That works fine and I get the alert box with the correct format, so it is the same as MySQL database. But I don't get the alert box, that the load was performed. Can anybody see why I don't get this call?

Best Regards
Mads

```
<form>
        <input id="start" />
    </form>

<script>
       $(function(){
            $("#start").datepicker({
                dateFormat: 'yy-mm-dd',
                onSelect: function(dateText,inst){
                    alert(dateText);

                    $.get("dataExchange.java", {start: $("#start").val()}, 
                            function( data ) {
                                alert("Load was performed");
                    });
                }
            });
        });
</script>

```
['https://Stackoverflow.com/questions/22202342', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1883095/']
You are trying to call your java class directcly `$.get("dataExchange.java" ...` You must use your URL mapping for the servlet. You can map the servlet in the `web.xml` file or with annotations.

If you put your servlet an web.xml we can provide more help.
Answer:

```
$(function(){
    $("#start").datepicker({
        dateFormat: 'yy-mm-dd',
        onSelect: function(dateText,inst){
            alert(dateText);
            //Her skal du så lave din ajax kald:
            $.ajax({
                  url: "../dataExchange",
                  type: "post",
                  data: Date,
                  success: function(){
                      alert("success");
                       $("#result").html('submitted successfully');
                  },
                  error:function(){
                      alert("failure");
                      $("#result").html('there is error while submit');
                  }   
                });
        }
    });
});

```