Announcement

Collapse
No announcement yet.

cannot disable hmtl image field ???

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Last edited by nacyil; 04-29-2015, 08:33 AM.

  • #2
    Nobody knows how to do that ??

    Thanks

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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:

          Code:
          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
          Last edited by jsbinca; 05-04-2015, 10:26 AM.

          Comment


          • #6
            Originally posted by jsbinca View Post
            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:

            Code:
            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
            We missed you a lot jsb. Great tip to allow "buttons" next to fields or somewhere.
            /Giuseppe

            Professional Scriptcase Services
            Some Customers opinions

            Comment


            • #7
              Thanks jsb

              Comment

              Working...
              X