Skip to content Skip to sidebar Skip to footer

Javascript And Behave Strange

I have a js-function codeAddress() that processess the data from address and updates the values of fullAddress and validField. The data of fullAddress and validField is passed by &

Solution 1:

This is not a duplicate question.
The first fault was using <p:ajax> to submit data that was to be altered by JS, because the ajax request is already prepared while the script is still running. The second mistake was to use the non-cross-browser-compatible jsf.ajax.request. Now I simply deleted the <p:ajax> and use a solution with jQuery. This function is simply called from the geocoders callback function:

function jsfSubmit(){
    document.getElementById('addressForm:fullAddress').value = fullAddress;
    document.getElementById('addressForm:validField').value = valid;
    $.ajax({type:'POST', data:$('#addressForm').serialize(), success: function(response) {
        if(valid){
            var destPage = 'nextPage.xhtml';
            window.location = destPage;
        }
    }});
};

Post a Comment for "Javascript And Behave Strange"