I thought I had this working, but now it turns out the form is getting
submitted twice.

I can see why it is getting submitted twice, but can't figure out how
to change it and make it all work
the problem is I don't have the data to be submitted until I run
another function.

I tried calling that function from the data line like this

[code]
$('#filterList').ajaxForm({
   target:       '#holdBands',
   beforeSubmit:  submitFilter,
   type:         'post',
   data: searchBy Address

});
[/code]
but that didn't work (I removed the ajax response from the
searchByAdress function when I tried this, but still got nothing).

here is the code I have now, which works but submits twice

[code]
$('#filterList').ajaxForm({
   target:       '#holdBands',
   beforeSubmit:  submitFilter,
   type:         'post'

});


        function submitFilter(formData, jqForm, options) {
        var queryString = $.param(formData);
        var addressTo = queryString.split('=');
        searchBYAddress();

        }
  function searchBYAddress() {

                  $('#map').jmap("searchAddress", {
    address: $('#address').val()
  },
  function(options, point) {
    $('#map').jmap({pointLatLng:[point.y, point.x], pointHTML:
'Address' + options.address });
        $('#map').jmap('init', {mapCenter: [point.y, point.x]});
        $('#holdBands').html('<img src=\"images/ajax-loader.gif\">');
        $.ajax({
                        type: "POST",
                        url: "processes/showList.php",
                        data: "lat="+point.x+"&long="+point.y,
                        success: function(response){
                                        $('#holdBands').html(response);
                                                $("#holdBands").jScrollPane();
                        }
        })

        });

    }
[/code]

I have also tried to adding a 'return false' statement on the form
submit, but that didn't help either....

I'm sure this is fairly easy, but I just can't quite figure it out.
Pete

Reply via email to