-
shkdxb
- Veteran Member
- Posts: 40
- Joined: 2013-06-28 18:18
Post
by shkdxb » 2013-07-27 04:11
hello,
I am trying to block updates to records if "UpdateAllowed" field contains "No" as value.
I have inserted the code inside PHP file common.js.php under "function MainTable_validateData()" after all validation commands,but the code is not working. Don't know why. any help?
Code: Select all
if($('UpdateAllowed').value=='No'){
Modalbox.show('<div class="Error" style="width: 90%; margin: 0;">You can\'t Update anymore!</div>',
{
title: "Update Blocked!",
afterHide: function(){ $('UpdateAllowed').focus(); }
}
);
/* returning false stops form submission */
return false;
};
-
shkdxb
- Veteran Member
- Posts: 40
- Joined: 2013-06-28 18:18
Post
by shkdxb » 2013-08-13 17:22
no one can help??
-
shkdxb
- Veteran Member
- Posts: 40
- Joined: 2013-06-28 18:18
Post
by shkdxb » 2013-08-15 03:32
i tries to do this in different way now
inserted the code below in function MainTable_update($selected_id) in file MainTable_dml.php.
Code: Select all
if($data['UpdateAllowed']=='No'){
echo StyleSheet() . "\n\n<div class=\"Error\">{$Translation['error:']} 'Update not Allowed':No more updates allowed for this record!! already blocked for updates.<br /><br />";
echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>';
exit;
this works if the field "UpdateAllowed" is not Read only. if i make this field read only, this is not working.
pl pl someone help.