Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 814185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:28:45+00:00 2026-05-15T01:28:45+00:00

I have a form. I am trying to validate it through AJAX GET requests.

  • 0

I have a form. I am trying to validate it through AJAX GET requests.

So i am trying to send the field values in the GET request data.

$('#uxMyForm').serialize();

the problem it is returning something undecipherable. I have used serialize before. This is totally bizzare.

the return value of serialize is

 actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&customer%5BuxName%5D=&customer%5BuxEmail%5D=&customer%5BuxResidentialPhone%5D=&customer%5BuxMobilePhone%5D=&customer%5BuxDateOfBirth%5D=&customer%5BuxAddress%5D=&customer%5BuxResidentialStatus%5D=

i have no idea how to use this.

Thanks

update:

My question is how do i process such a request? like this?

puts params[:data][:customer][:uxName]

my GET request trigger looks like this

$.get('/site/sign_up',{data : $('#uxMyForm').serialize() }, function(data){
 alert(data);
});

The above jquery lines generate the request.. on the action method i do the following

render :text => params

when i observe what is sent in the GET,in firebug PARAMS

**data** authenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=

the return value that i print in alert has

actionsign_upcontrollersitedataauthenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6%2FQ0zLeQqwIahJZJfE%3D&direct_customer%5BuxName%5D=&direct_customer%5BuxEmail%5D=&direct_customer%5BuxResidentialPhone%5D=&direct_customer%5BuxMobilePhone%5D=&direct_customer%5BuxDateOfBirth%5D=&direct_customer%5BuxAddress%5D=&direct_customer%5BuxResidentialStatus%5D=
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T01:28:45+00:00Added an answer on May 15, 2026 at 1:28 am

    How does the form itself look. I have no experience with Ruby on rails – and if it builds the form in a new exciting way – but it looks as if there’s only two form elements: authenticity_token and customer – where customer is an array of items. This is the data you posted, but I urldecoded it and put in some linebreaks:

    authenticity_token=oRKIDOlPRqfnRehedcRRD7WXt6/Q0zLeQqwIahJZJfE=
    &customer[uxName]=
    &customer[uxEmail]=
    &customer[uxResidentialPhone]=
    &customer[uxMobilePhone]=
    &customer[uxDateOfBirth]=
    &customer[uxAddress]=
    &customer[uxResidentialStatus]=
    

    What you could do is to serialize the form to an array and clean it up before sending it using jQuery ajax request. I did something similar once when I had to serialize .net runat-server form elements:

    var serializedData = $(form).serializeArray();
    for( i=0; i < serializedData.length; i++)
    {
        // For each item in the array I get the input-field name after the last $ character
        var name = serializedData[i].name;
        var value = serializedData[i].value;
        if( name.indexOf('$') != -1)
            name = name.substr( name.lastIndexOf('$')+1 );
        serializedData[i].name = name;
    }
    var ajaxPostData = $.param(serializedData);
    

    So instad of blabla$ABCPlaceHolder$tbxEmail I got tbxEmail in the array. You could do the same to get uxName, uxEmail etc instead of the customer array.

    Note then again, however, due to my inexperience with ruby that this may not be the best solution – maybe there’s a setting you can change to build the HTML form differently?

    Updated:

    I’m not sure how ruby works, but after a googling I found you should be able to receive your values using params:customer as an array.

    params:customer should contain an array of the values

    {:uxName => "", :uxEmail => "" }
    

    I hope that tells you something on how to receive the data. Maybe (warning – wild guess!) like this?

    params[:customer][:uxName]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a strange problem. I am trying to validate one form sent through
I have a form with radios and trying to validate starting with jq/$.ajax and
i have been trying to validate This Form: <table> <form action=test.html method=post id=contactform name=contactform>
I have a form that is trying to insert some data into an SQL
I have a form with multiple dropdowns consisting of multiple values. I'm trying to
I am trying to validate a form submission in Kohana 3. I have the
I have a jQuery Dialog form and on submit I'm trying to validate the
I'm trying to validate a form using an AJAX call to check available inventory.
I'm trying to validate a form using Data Annotation. It seems great for string
I have a form dynamically created using Jquery and i am trying to validate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.