Announcement

Collapse
No announcement yet.

buttons beside a filed/control

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

  • buttons beside a filed/control

    hi does anyone know how to add a button beside a control. let's say i have text box then i want to have a button with particular functionality on it. how to do so? thank u!.

  • #2
    Hi rendonjerome14,
    You can use jQuery.

    Code:
    $('#selector').append('<input type="button" value="label" onClick="call_function()">');
    Best Regards
    Hiram BQ

    Comment


    • #3
      hi. thanks just one more question, how will i disable an item list in a check box for example. my check box has item1, item2, item3. i wanna disable item3 thru code.

      Comment


      • #4
        how to do that? where will I use this code?
        $('#selector').append('<input type="button" value="label" onClick="call_function()">');

        Comment


        • #5
          To disable an item using jquery:
          Code:
          $('#selector').attr('disabled', 'disabled');
          Best Regards
          Hiram BQ

          Comment


          • #6
            I recommend you to read about javascript and jquery. To read about jquery selectors: http://www.w3schools.com/jquery/jque..._selectors.asp
            Best Regards
            Hiram BQ

            Comment


            • #7
              It's not always a matter of the javascript, but the way to apply it into your code. I think that it would help if there's a sample of it somewhere. I for this reason avoid using javascript although I'm pretty familiar with JQuery(UI). But SC generates a lot so you need to be pretty technical to extract the knowledge you need to apply your customisations.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment


              • #8
                Example to disable input.
                Lets say that your field name is "myfield", then your selector is "id_sc_field_myfield".

                Place this code onLoad:
                PHP Code:
                echo "
                <script>
                $(document).ready(function(){
                 $('#id_sc_field_myfield').attr('disabled', 'disabled');
                });
                </script>"


                Scriptcase is awesome, but if you want to make better customizations you need of javascript and php.
                Best Regards
                Hiram BQ

                Comment

                Working...
                X