Skip to content

How to grab value of multiselect in php #323

@aaron4osu

Description

@aaron4osu

I have a form that uses the multiselect as well as other text input fields. When I try to send to php using JQuery ajax request I'm only getting the last item in the multiselect. I know the values are stored on the var options, because I tested it with an alert. But how do I add it to the .home1 form to serialize and send over to php?

var options = validator.getFieldElements('product').val();
 $.ajax({
   type: "POST",
   url: "process-step1.php",
   data: $('.home1').serialize(),
   success: function(msg){
       document.location.href = 'form.php';
    },
   error: function(){
     alert("error");
   } 
 });//close ajax              

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions