Jump to content

Form action attribute submits to remote website


brianlange

Recommended Posts

What do you mean it's duplicated?

 

Do you mean in your $_REQUEST[] array there is two values for each parameter??

 

That shouldn't matter assuming the page you are posting to has there data being organized after post and not looped through. Maybe a little more detail would help the community understand what's going on.

 

One thing that I know commonly happens with arrays is this:

 

array(

    ["MY_FIELD"] => VALUE

    [0]                => VALUE

    ["MY_FIELD2"] => VALUE2

    [1]                  => VALUE2

)

 

That way you have the option to access the key as a numbered value or as your chosen field name.

 

More details please :)

 

E

Thanks for the response. ie didn't seem to like that I was submitting the form with jquery.  Here's my jquery code

 $.ajax({type: 'POST', 
                url: '/index/check-email', 
                async: 'false', 
                data: {email: $('#email').val()}, 
                complete: function(XMLHttpRequest, textStatus) {
            
                if (XMLHttpRequest.responseText == 'fail') {
                    
                    $('#norisk').css("display", "none");
                    $('p.error').css("display", "block");
                    return false;
                       
                } else {
                    return true;
                    //$('#form').submit();
                   
                } 
    }});

 

So I removed the submit code and added onsubmit="return checkForm();"

This code also has issues with IE.  I tried adding an onclick event to the submit button but the problem persists.

ie doesn't like my ajax call. Why wouldn't it?

 

I don't work with jQuery, much. I would say try creating a standard AJAX call using the XMLHttpRequest object. Google it if your not sure what it is.

 

If that works, you can guarantee it's a jQuery compatibility issue.

 

Assuming it is jQuery:

 

1. check for known bugs, by jQuery

2. check for a new jQuery update

3. consider not using jQuery at all

 

JS Debugging:

 

Place alerts in different areas of your js that will show you:

 

1. once your function has been fired

2. once your data/post variables have been set

3. request status

4. request result

 

These things may give you a better idea of "what" is happening in more detail.

 

I wish I could be more helpful with jQuery specifically. Maybe post this up on the AJAX Help forum; http://www.phpfreaks.com/forums/ajax-help/

 

Good luck,

 

E

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.