This topic is locked

howto disable fields inside inline edit

1/25/2008 7:20:26 AM
ASPRunnerPro General questions
M
mstx04 author

Hello,
I have created a javascript that disables text boxes on the edit page based on a value in another field. If DataSourceID == 1 then are some boxes editable, and if DataSourceId == 2 are some other boxes editable. My question is, how do I get the same behaviour in the Inline edit?
Regards,

Mikael

Sergey Kornilov admin 1/29/2008

Mikael,
you can use Edit page: BEfore record displayed event.

Make sure you replace field names with real ones:

global $data;

if(@$_REQUEST["editType"]=="inline")

{

$linkdata = $smarty->get_template_vars("linkdata");

if($data["YearOfMake"]>2001)

{

$linkdata.="\r\ndocument.getElementById('value_Make_".postvalue("recordID")."').disabled=true;";

}

$smarty->assign("linkdata",$linkdata);

}