Jump to content

& Symbol problems


davelearning

Recommended Posts

Hi All,

 

I have the below:

$("form#caption").submit(function() {

var i_title = $('#i_title').attr('value');
var p_id = $('#p_id').attr('value');
var datastring = 'i_title='+ i_title +'& p_id='+ p_id;

	$.ajax({
		type: "POST",
		url: "includes/captionupdate.php",
		data:  datastring,
		success: function(){
			$('form#caption').hide(function(){
			$('div.success').fadeIn();}); 
			window.location.reload(),5000; 
  			
            }  
        });  
    return false;  
    });  
});  

 

This works fine unless the i_title field contains an & symbol, in which case nothing is parsed after it, how do I go about correcting this? For instance if my i_title was Me & My Dog, the i_title would save as Me

 

Link to comment
https://forums.phpfreaks.com/topic/224279-symbol-problems/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.