I have a link that needs to pass the name of of the div 'bnkcontent' to the AJAX function editcustomer(). I am getting errors from the line of code below.
echo'<a href="#" name="edit" id="edit" onclick="javascript:editcustomer('bnkcontent');">'.'edit details'.'</a>';
below is the function its calling:
function editcustomer(SpanName)
{
var address = document.getElementById('address');
var town = document.getElementById('town');
var postcode = document.getElementById('postcode');
var telephone = document.getElementById('telephone');
var email = document.getElementById('email');
var opassword = document.getElementById('opassword');
//alert(opassword.value);
var password = document.getElementById('password');
var cpassword = document.getElementById('cpassword');
var memword = document.getElementById('memword');
var cmemword = document.getElementById('cmemword');
var curDateTime = new Date(); //For IE
var poststr = "address=" + address.value + "&town=" +town.value + "&postcode=" +postcode.value + "&telephone=" +telephone.value + "&email=" +email.value + "&opassword=" +opassword.value + "&password=" +password.value + "&cpassword=" +cpassword.value + "&memword=" +memword.value + "&cmemword=" +cmemword.value;
alert(poststr);
var SpanName = SpanName;
makePOSTRequest('test.php', poststr, SpanName);
}
**should be removed.{}.