Welcome Guest, Not a member yet? Register   Sign In
submit a form with jquery serialize() and upload images??
#1

[eluser]Zeeshan Rasool[/eluser]
hi all,
im using CI inmy project and currently i have a issue. Actually im sending a form thru jquery serialze(). The form contains listing information of realtors.
Form is a very big one so i used serialize() to get form values and passed then to ajax like:
Code:
$.ajax({
  type: "POST",
  url: "<?php echo base_url();?>cms/update_listing",
  data: str,
  success: function(msg){
    $("#round1").ajaxComplete(function(event, request, settings){
     var org = $("#round1").html()
    $("#round1").html(msg)
   .hide()
   .fadeIn(1500);
});
I have also to upload many images So can images be uploaded like this i mean using jquery ajax???
Also how can i upload images in this case ??
please suggest any solution.
[Note: backend script is just getting values from form and update record in DB but images can't be uploaded]
#2

[eluser]bijufun[/eluser]
having same problem me too..
#3

[eluser]Unknown[/eluser]
I found one article about ajax.

The .serialize() method can act on a jQuery object that has selected individual form elements, such as &lt;input&gt;, &lt;textarea&gt;, and <select>. However, it is typically easier to select the &lt;form&gt; tag itself for serialization:

ref: http://api.jquery.com/serialize/

I spotted the same problem. Also did not find a solution.
Hope there is someone to help solve this problem.




Theme © iAndrew 2016 - Forum software by © MyBB