Send cutomized data in ajax script

4 views
Skip to first unread message

Taruna Sharma

unread,
May 21, 2019, 5:24:12 AM5/21/19
to xamp...@googlegroups.com
Hi all,

I want to send cutomised data in ajax script.

$('input[type="text"]').each(function(){  
  sdata=sdata+"'"+$(this).attr('name')+"':"+$(this).attr('name')+",";
  if($(this).attr('name')=='mobile')
  { return false };        
});
sdata=sdata+"'case':7}";  // { 'name':name,'email':email} //script is genrating this 

xhr = $.ajax({
type: 'POST',
url: 'online-search.php',
data: sdata,  // nothing is coming in return

or any other way to submit form data via ajax ????







Kind Regards,
Taruna Sharma

vikas dwivedi

unread,
May 31, 2019, 1:28:28 PM5/31/19
to xamp...@googlegroups.com
You need to share xhr request from developer console.

Also you can use some break statement on server side to check your response.

Ex:In your php script use echo 'test';exit; 

--
Ask New Question from : https://groups.google.com/forum/?fromgroups#!newtopic/xamppdev
 
Create filter of mails from this group http://www.wikihow.com/Create-a-Filter-in-Gmail
---
You received this message because you are subscribed to the Google Groups "PHP Developers' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xamppdev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xamppdev/CA%2BMS37r09WLH5zw%3DQ6EYQVDVa4ubtaGQYh0_pY6Ry2%3DigWybig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages