This topic is locked

Inline Add Changed Enter Key

1/5/2016 3:39:54 AM
PHPRunner General questions
C
carrie3800332 author

一.User Need Inline Add Changed Enter Key

Events →List Page →JavaScript OnLoad event →

$(document).keyup(function(e) {

if (e.keyCode == 13)

{

document.getElementById("inlineAdd1").click();

}

});
二.Changed Enter Key after that original

Addd Page →Before record added code

global $bud_m,$conn;
$sql="select max(ser_no) as ser_no from buy_d where sno='".$values[sno]."' ";
echo $sql;

$rs = CustomQuery($sql);

$data=db_fetch_array($rs);
if($data['ser_no']!='' or $data['ser_no']!=null)

{

$ser_no=($data['ser_no']+1);

$values['ser_no']=substr(strval($ser_no+10000),1,4);

db_exec($sql,$conn);

}else{

$values['ser_no']='0001';

db_exec($sql,$conn);

}

$values['per_no']=sprintf("%s",$values['sno']).sprintf("%s",$values['ser_no']);
return true;
三.add two row data → [save all]Executive program Error occurred →

Message "RECORD_NOT_ADDED" Duplicate entry 1444A12-0008' for key

advice on how to deal with this problem

Thanks for help~

Sergey Kornilov admin 1/5/2016

Unfortunately this code alone doesn't make much sense. It also doesn't look like this error is related to the code, it is more like incorrect master-details relationship setup. Hard to tell though without seeing project and database structure.