Adding code to allow me to save the values in the code

 function sendRegForm(el, callback){
        $.post('/wp-admin/admin-ajax.php',
                                        {
                                            action: 'idx_register_user',
                                            firstname: $('#form-firstname').val(),
                                            lastname: $('#form-lastname').val(),
                                            email: $('#form-email').val(),
                                            phone: $('#form-phone').val(),
                                            pw: $('#form-password').val()
                                        },
                                        function (data) {
                                            if('true' == data){
                                                $('.idx-reg-form-response').addClass('idx-form-success');
                                                $('.idx-reg-form-response').text('Success');
                                                $('.idx-reg-form-response').slideDown();
                                                setTimeout(function(){
                                                    $('.idx-modal-cover').fadeOut();
                                                    $('.idx-modal-cover').remove();
                                                }, 1500);

                                                idxRegNotify($(el).data('reason'));
                                                callback(el);
                                            }
                                            else{
                                                $('.idx-reg-form-response').addClass('idx-form-fail');
                                                $('.idx-reg-form-response').html(data);
                                                $('.idx-reg-form-response').slideDown();
                                                return false;
                                            }
                                        });

Is there a way i can use javascript, or jQuery to add some code that will open a file like text or php and save the data as it passes thru… what I want to grab is:
firstname: lastname: email: phone and pw. without disturbing the system as it continues.
With php i fully understand how to tap into the program and record what ever values that i need but not to sure with javascript, jquery and other such.

No there’s not, for many security-based reasons.

Some possible options though that you might want to investigate are cookies or local storage.

Thanks for the quick response… i have access to the entire code and could download the specific page and physically add to the code if that would help… but just not sure what to write to grab that data…if actually added to the page would then allow access to any of the data… correct… I would think a simple couple of lines of jquery, or javascript added at correct point would work… or still NO…

Well the easiest way to gain access to the information without needing to deal with the file access issues is to log that information to the console.

That way, when you run the page, the browser console shows you all of that information.

console.log({
    firstname: $('#form-firstname').val(),
    lastname: $('#form-lastname').val(),
    email: $('#form-email').val(),
    phone: $('#form-phone').val(),
    pw: $('#form-password').val()
});

Is something like this possible so it continues to run after printing… or is this totally off base…
If i knew how to format it to save in a file it would not break it… but my guess is this will break it and not run at all??

    function sendRegForm(el, callback){
        $.post('/wp-admin/admin-ajax.php',
                                           {
                                            action: 'idx_register_user',
                                            firstname: $('#form-firstname').val(),
                                            lastname: $('#form-lastname').val(),
                                            email: $('#form-email').val(),
                                            phone: $('#form-phone').val(),
                                            pw: $('#form-password').val()
                                           },

                     console.log(firstname: $('#form-firstname').val());
                     console.log(lastname: $('#form-lastname').val());
                     console.log(email: $('#form-email').val());
                     console.log(phone: $('#form-phone').val());
                     console.log(pw: $('#form-password').val());

                                        function (data) {
                                            if('true' == data){
                                                $('.idx-reg-form-response').addClass('idx-form-success');
                                                $('.idx-reg-form-response').text('Success');
                                                $('.idx-reg-form-response').slideDown();
                                                setTimeout(function(){
                                                    $('.idx-modal-cover').fadeOut();
                                                    $('.idx-modal-cover').remove();
                                                }, 1500);

Thanks again for your help…

Yes, that will break. You could place it immediately after the sendRegForm function line instead.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.