Announcement

Collapse
No announcement yet.

can we add a new button to a block

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

  • can we add a new button to a block

    hi

    I'm still new and exploring scriptcase, looks nice so far.

    Wondering if I want to add some buttons next to the fields in the blocks? like if you want to make a new button and add it to the right of the field as "apply" or "validate" - I noticed the validation image, my need is a new button that from the toolbar but to be shown along with the fields? does it make sense? similar to the ones come with field type URL and Email, just additional button to the right of the field...

    in Form application (single record)

  • #2
    Originally posted by Leon View Post
    hi

    I'm still new and exploring scriptcase, looks nice so far.

    Wondering if I want to add some buttons next to the fields in the blocks? like if you want to make a new button and add it to the right of the field as "apply" or "validate" - I noticed the validation image, my need is a new button that from the toolbar but to be shown along with the fields? does it make sense? similar to the ones come with field type URL and Email, just additional button to the right of the field...

    in Form application (single record)
    In general there are only six places where the buttons can be put if you use the add button functionality, top, bottom and left, middle and right.

    What I sometimes do is that i create a custom field and make that of type image. Then I have a small image of a button which can be put behind some field, although the screenpainting capabilities are (very) limited. You need to create a group with two fields (the field and your button) to allign them next to each other. Disadvantage is also that you can only put a link behind that image and you cannot use the button events. Sometimes I link to a blank application to do some things and then sc_redir back to the original application. Sometimes you have to go with what's available ;-)

    hope this helps.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hi
      -1- Create your button and javascript you want to be performed when the button is clicked.
      -2- Place the button in the toolbar and run the application
      -3- Right click your button and click 'Inspect element' you will see a code like that (that's an example, your code will be a little different):

      <a href="javascript: sc_btn_sc_btn_1()" id="sc_sc_btn_0_top" onclick="sc_btn_sc_btn_1(); return false;" class="scButton_default" style="vertical-align: middle; display:inline-block;" onmouseover="if(this.disabled){ return false; }else{ main_style = this.className; this.className = \'scButton_onmouseover\'; }" onmouseout="if(this.disabled){ return false; }else{ this.className = main_style; }" onmousedown="if(this.disabled){ return false; }else{ this.className = \'scButton_onmousedown\'; }" onmouseup="if(this.disabled){ return false; }else{ this.className = \'scButton_onmouseover\'; }">Cliquez pour début visite</a>;

      Copy that code

      -4- Create your field and put it where you want in your form
      -5- In the onLoad event, create a code like :


      {myLabel}='<a href="javascript: sc_btn_sc_btn_1()" id="sc_sc_btn_0_top" onclick="sc_btn_sc_btn_1(); return false;" class="scButton_default" style="vertical-align: middle; display:inline-block;" onmouseover="if(this.disabled){ return false; }else{ main_style = this.className; this.className = \'scButton_onmouseover\'; }" onmouseout="if(this.disabled){ return false; }else{ this.className = main_style; }" onmousedown="if(this.disabled){ return false; }else{ this.className = \'scButton_onmousedown\'; }" onmouseup="if(this.disabled){ return false; }else{ this.className = \'scButton_onmouseover\'; }">Cliquez pour début visite</a>'; (The code you have copyed)

      sc_label("nameOfYourField")={myLabel};

      -6- Remove the button in the toolbar and run your application :-)

      Comment


      • #4
        Nice! Like that Q&D approach.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Good Idea!. I will try

          Comment


          • #6
            Great thanks danigo.

            one small question to Mr Drent after thanking you for your previous feedback. did you mean by group buttons something like create 2 custom files and hide them then combine them in other filed like {field_new_db_field}={field_1_custom} {field_2_custom} ??

            in this case, can't we apply some ajax events to custom field (html image) so it will be applied on click!?

            Comment


            • #7
              No, I create a custom field of type image and put that in the form. But to be able to customize layout I need to create a block and apply the two fields (the original + the image). But the disadvantage is that you have to create a link, in that matter the other solution might work better.
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment


              • #8
                We need a field type "button"

                Dave
                Dave Prue
                Code Whisperer
                Lahar International Corp
                www.lahar.net

                Comment


                • #9
                  That sounds like a familiar request I also made...

                  Comment


                  • #10
                    Originally posted by aducom View Post
                    No, I create a custom field of type image and put that in the form. But to be able to customize layout I need to create a block and apply the two fields (the original + the image). But the disadvantage is that you have to create a link, in that matter the other solution might work better.
                    yes I understand now, also sdanigo solution is great, will give it a try. thanks again Mr Drent and sdanigo

                    Dave is speaking correct, a field like button will be great to have.

                    rr, here we have more than workaround to do this request, will try and see which one suites better


                    thanks

                    Comment

                    Working...
                    X