We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello, i'm having a problem with eform and ajax...


    I have a form with a jQuery code that I'm using to validate and call some content using Ajax into a <option field:

    <form method="post" action="[~[*id*]~]" id="bookingForm" name="bookingForm">
    <input name="forxmid" type="hidden" value="bookingForm" />
    ...
    code code code
    ...
    </form>
    <script>
    ...
    code code code
    ...
    var loadToPlaces = function (fromPlaceId) {
    
        var params = {"method":"loadToPlaces", "fromId":fromPlaceId};
        $.ajax({
            [b]type: "POST",[/b]
            url: "[~208~]",
            data: params,
            dataType: "json",
            success: function(data) {
                $('#toSelect').empty();
                $.each(data.places, function(index, value) {
                    $('#toSelect').append('<option value="' + value.id + '__' + value.location + '">' + value.name + '</option>');
                });
    
                $('#toSelect').change(
                        function() {
                            var dataArray = $(this).val().split("__");
                            setMarkerPosition(dataArray[1], false);
                        }).trigger('change');
            }
        });
    };
    </script>
    


    Everything works perfect, BUT the SEND button is not sending the form, the problem is this:

    type: "POST",


    If i change POST to GET for example, the form works perfect, but the <option will not get the info....

    ANY IDEAS???
    Thank you very much.
      --
      ysanmiguel.com
      • 33238
      • 388 Posts
      No answers. no ideas??? ANY HELP PLEASE???
        --
        ysanmiguel.com