cannot disable hmtl image field ???

Hello,

I would like to disable/enable Html image field in ajaxevents and load event
I tried disable_field(), display(), readonly() but doesn’t work !!!

Any idea ??
sc v.8.35

Thanks
Nac

Nobody knows how to do that ??

Thanks

Without knowing any specifics, sc_field_display({your_html_field},‘off’) does work in the onLoad and Ajax events.
Otherwise I would suggest to use a label field instead which is more flexible.

jsb

I use html field because I can click on it to open a modal windows , I tried with a label field but I cannot add a link on it

Thanks

OK, here is a basic example for a label field (fld_label1) to activate/deactivate a link.

Create a button of type link (i.e. mybtn) and configure the link to your liking.
Remove the button from the toolbar.

onLoad:


if($status == 1)
{
    {fld_label1} = "<img src='path_to_image' style='cursor:pointer;' onclick='sc_btn_mybtn()'</img>"; //show image with active link. Custom button names begin with 'sc_btn_'
}
else
{
    {fld_label1} = "<img src='path_to_image'</img>"; //show image without link.
}


Hope this helps.

jsb

[QUOTE=jsbinca;36290]OK, here is a basic example for a label field (fld_label1) to activate/deactivate a link.

Create a button of type link (i.e. mybtn) and configure the link to your liking.
Remove the button from the toolbar.

onLoad:


if($status == 1)
{
    {fld_label1} = "<img src='path_to_image' style='cursor:pointer;' onclick='sc_btn_mybtn()'</img>"; //show image with active link. Custom button names begin with 'sc_btn_'
}
else
{
    {fld_label1} = "<img src='path_to_image'</img>"; //show image without link.
}


Hope this helps.

jsb[/QUOTE]

We missed you a lot jsb. Great tip to allow “buttons” next to fields or somewhere.

Thanks jsb