[eluser]cinewbie81[/eluser]
View File
Code:
// HTML code for Edit button
<input type="image" name="edit" onclick="GetRecord(this);return false;" src="<?php echo base_url();?>images/edit.gif" value="Edit" alt="Edit" title="Edit Record" height="50px" width="40">
Javascript file - after Edit utton clicked
Code:
function GetRecord (button)
{
var form_id = document.getElementById('form_id');
var checked_values='';
for (a=0; a<form_id.elements.length; a++)
{
if (form_id.elements[a].type == 'checkbox'
&& form_id.elements[a].name == 'checkbox')
{
if (form_id.elements[a].value && form_id.elements[a].checked)
{
checked_values += form_id.elements[a].value;
break;
}
}
}
runAction(button,checked_values);
return false;
}
function runAction(button,str)
{
if (str == '') {
alert('Please make a selection from the list');
return;
}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
xmlHttp.onreadystatechange=actionstatechange;
var url =
button.par[b][/b]entNode.pare[b][/b]ntNode.action+"?button="+button.name+"&d;="+str+"&sid;="+Math.random();
window.l[b][/b]ocation.href = url;
return false;
}
My Controller file
Code:
function action()
{
if ($_REQUEST['button'] == 'edit') {
// Perform Edit here
}
}
When the system go to the action function shown above, it give me the following error:
A PHP Error was encountered
Message: undefined index:button.
It's work in Firefox, and works in my Testing PC (which is both IE 6 and 7) ... Anyway, some my clients who are using IE7 having the problem mentioned above each time they click the EDIT button. WHat's wrong with the code, any idea?