How to disable radio button in client script → startup script?
Google jquery radio button disabled.
mobhar wrote:
Google > jquery radio button disabled> .
Tested with lots of combination from above search results and non of them working in phpmaker 2022.8
$(this).fields(‘fldname’).prop(‘disabled’, true);
$(this).fields(‘fldname’).attr(‘disabled’, true);
$(“#x_fldname”).fields(‘fldname’).prop(‘disabled’, true);
$(“#x_fldname”).fields(‘fldname’).attr(‘disabled’, true);
even try with (‘readonly’, true/false), (‘disabled’, ‘disabled’)…
If you just want to disable that Radio Button as per your case, then you should use Page_Load server event that belongs to the Add Page and/or Edit Page:$this->fldname->ReadOnly = true;
It also depends on the Edit Tag settings of the field.
mobhar wrote:
If you just want to disable that Radio Button as per your case, then you should use
Page_Load > server event that belongs to the Add Page and/or Edit Page:> $this->fldname->ReadOnly = true;
Thanks mobhar,But this field is disabled base on (runtime) condition.eg. when I entered an amount into the amount field, I wanna disable the trxtype radio button. But when the amount field is 0, I need to enable the trxtype field. So, must do it in client script → startup script like
$(“#x_amount”).on(‘change’, function() {
$(“#x_trxtype”).prop(‘disabled’, ($(“#x_amount”).val() != 0));
});
above syntax worked in text, lookup but not radio.
Then you may post your Edit Tag settings of the field as arbei mentioned above.
Is this the edit tag setting?
<Field
FldName="trxtype"
FldType="16"
FldTypeName="TINYINT"
NativeDataType="1"
FldSupport="1"
FldSort="0"
FldSize="4"
FldReq="1"
FldAttribute="4"
FldValidate="INTEGER"
FldRequired="1"
FldGenerate="1"
FldList="1"
FldEdit="1"
FldAdd="1"
FldAddOpt="1"
FldSrchOpr="="
FldDefault="0"
FldDbDefault="0"
FldCaption="Trx Type"
FldViewTag="FORMATTED TEXT"
FldHtmlTag="RADIO"
FldTagSize="30"
FldTagMaxLength="0"
FldTagValues=""0","Buy"|"1","Sell""
FldHtmlTagReadOnly="1"
FldSelectType="Values"
FldTagAPrefix="None"
FldFmtType="Number"
FldIncLeadDigit="-2"
FldUseParen="-2"
FldGpDigits="-2"
FldColumnWrap="0"
FldResizeQuality="75"
/>
Please describe it by using the option name setting you already changed/adjusted from Edit Tag pane, not only by posting the xml node/code from your .pmp file, so others could reproduce it based on it.
Not too sure why after upgrade to v2022.9.0, my existing code are working now.Thanksscs