Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Need help how can i add a script to drop down links

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

    Need help how can i add a script to drop down links

    I have a few drop down lists and i would like to add a event script to each item in the list. I can not see how to do this.

    Like the drop down list is

    test 1 when clicked on it runs a script to make it run
    test 2 when clicked on it runs a script to make it run
    test 3 when clicked on it runs a script to make it run
    test 4 when clicked on it runs a script to make it run

    How do i attach a event script to each drop down list item???

    Thanks

    #2
    Re: Need help how can i add a script to drop down links

    I do not know of a way to directly do that, however, indirectly you could program the OnChange or OnDepart event of the object.
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      Re: Need help how can i add a script to drop down links

      Ed,

      Using Action Scripting look under Scripts -> Display a List of Scripts.

      Will that do what you want?

      ba

      Comment


        #4
        Re: Need help how can i add a script to drop down links

        Digitaled

        What Bob said you could create a "button" on your form to open a picklist of scripts that the user can run, You can edit this picklist to present the user with,Test1, Test2, Test3, test4,as the names for the underlying scripts. As Bob said this is done with "action scripting" and "Display a pick-list of scripts" There was a turbo-Demo of this awhile back, but it seems unfortunately all these referances keep disappearing.I have enclosed the TurboDemo. Just Unzip and run the ScriptPickList.htm file in your browser.

        Hope this helps

        Comment


          #5
          Re: Need help how can i add a script to drop down links

          Thats different not the way i want it to work.

          What is the point of having a drop down list box if i can not program each item in the list to do something?

          I need to add this

          sys_shell("C:\testA\testB\test.exe C:\testA\testB\Trigger.jpg",1)

          to each item in the drop down list.. no way to do that so when each is clicked on it will run this scropt..?

          Originally posted by popellis View Post
          Digitaled

          What Bob said you could create a "button" on your form to open a picklist of scripts that the user can run, You can edit this picklist to present the user with,Test1, Test2, Test3, test4,as the names for the underlying scripts. As Bob said this is done with "action scripting" and "Display a pick-list of scripts" There was a turbo-Demo of this awhile back, but it seems unfortunately all these referances keep disappearing.I have enclosed the TurboDemo. Just Unzip and run the ScriptPickList.htm file in your browser.

          Hope this helps

          Comment


            #6
            Re: Need help how can i add a script to drop down links

            Is programming the OnChange event not an option?
            Cheryl
            #1 Designs By Pagecrazy
            http://pagecrazy.com/

            Comment


              #7
              Re: Need help how can i add a script to drop down links

              Guess i do not know how to do that..?

              If i have say 6 items in the drop down like

              test 1
              test 2
              test 3
              test 4
              test 5
              test 6

              how do i add this code to each one to make it run when clicked on?
              The code will be the same for all of them except for a name change on each one.


              Originally posted by Cheryl Lemire View Post
              Is programming the OnChange event not an option?

              Comment


                #8
                Re: Need help how can i add a script to drop down links

                I think you are using the wrong terminology:
                A "drop down list" refers to, at least in the context of alpha, a list that will show when you are entering a value in a field in a table.

                For example: a drop down list showing the US States: Alabama, Alaska etc when you are adding a record that has a field for the State, then you choose one of those.

                What you need, is not a "drop down list", but rather a "Custom Toolbar".
                Go to the Code tab and follow the instructions on creating a custom toolbar.

                Comment


                  #9
                  Re: Need help how can i add a script to drop down links

                  Hi Ed,

                  Tell us exactly what it is you want to happen based on the different choices. If text 1 then do 'what', if text 2 then do 'what'

                  I would say that you would create a UDF, probably a select....case statement with the different choices.
                  Cheryl
                  #1 Designs By Pagecrazy
                  http://pagecrazy.com/

                  Comment


                    #10
                    Re: Need help how can i add a script to drop down links

                    Here is what it looks like.
                    Its a drop down list on a form. with buttons on both side of it.



                    Needs to run.

                    test 1 sys_shell("C:\testA\testB\test-1.exe C:\testA\testB\Trigger.jpg",1)
                    test 2 sys_shell("C:\testA\testB\test-2.exe C:\testA\testB\Trigger.jpg",1)
                    test 3 sys_shell("C:\testA\testB\test-3.exe C:\testA\testB\Trigger.jpg",1)
                    test 4 sys_shell("C:\testA\testB\test-4.exe C:\testA\testB\Trigger.jpg",1)
                    test 5 sys_shell("C:\testA\testB\test-5.exe C:\testA\testB\Trigger.jpg",1)


                    Originally posted by G Gabriel View Post
                    I think you are using the wrong terminology:
                    A "drop down list" refers to, at least in the context of alpha, a list that will show when you are entering a value in a field in a table.

                    For example: a drop down list showing the US States: Alabama, Alaska etc when you are adding a record that has a field for the State, then you choose one of those.

                    What you need, is not a "drop down list", but rather a "Custom Toolbar".
                    Go to the Code tab and follow the instructions on creating a custom toolbar.

                    Comment


                      #11
                      Re: Need help how can i add a script to drop down links

                      A dropdown like you show doesn't have an event for "first choice selected", "second choice selected", etc. Use Cheryl's suggestion and code the onchange event for whatever object is represented by the dropdown.

                      To get to the onchange event, edit the form, right click on the dropdown, choose events, select onchange, and enter something like

                      select
                      case o_sizes.value = "Test 1"
                      script_play("Name of a script")
                      'or you could have the script itself here (with an end statement, of course)

                      case o_sizes.value = "Test2"
                      script_play("Name of aother script")

                      case o_sizes.value = "Test3"
                      script_play("Name of aother script")

                      case o_sizes.value = "Test4"
                      script_play("Name of aother script")

                      case o_sizes.value = "Test5"
                      script_play("Name of aother script")

                      end select

                      In the above, o_sizes is the object name of the dropdown.
                      There can be only one.

                      Comment


                        #12
                        Re: Need help how can i add a script to drop down links

                        Ok i did this but it will not work?

                        select
                        case o_sizes.value = "Test 1"
                        script_play("sys_shell("C:\testA\testB\Test1.exe C:\testA\testB\Trigger.jpg",1)
                        'or you could have the script itself here (with an end statement, of course)

                        case o_sizes.value = "Test2"
                        script_play("sys_shell("C:\testA\testB\Test2.exe C:\testA\testB\Trigger.jpg",1)

                        case o_sizes.value = "Test3"
                        script_play("sys_shell("C:\testA\testB\Test3.exe C:\testA\testB\Trigger.jpg",1)

                        case o_sizes.value = "Test4"
                        script_play("sys_shell("C:\testA\testB\Test4.exe C:\testA\testB\Trigger.jpg",1)

                        case o_sizes.value = "Test5"
                        script_play("sys_shell("C:\testA\testB\Test5.exe C:\testA\testB\Trigger.jpg",1))

                        end select





                        Originally posted by Stan Mathews View Post
                        A dropdown like you show doesn't have an event for "first choice selected", "second choice selected", etc. Use Cheryl's suggestion and code the onchange event for whatever object is represented by the dropdown.

                        To get to the onchange event, edit the form, right click on the dropdown, choose events, select onchange, and enter something like

                        select
                        case o_sizes.value = "Test 1"
                        script_play("Name of a script")
                        'or you could have the script itself here (with an end statement, of course)

                        case o_sizes.value = "Test2"
                        script_play("Name of aother script")

                        case o_sizes.value = "Test3"
                        script_play("Name of aother script")

                        case o_sizes.value = "Test4"
                        script_play("Name of aother script")

                        case o_sizes.value = "Test5"
                        script_play("Name of aother script")

                        end select

                        In the above, o_sizes is the object name of the dropdown.

                        Comment


                          #13
                          Re: Need help how can i add a script to drop down links

                          Hi Ed,

                          Code:
                           script_play(sys_shell("C:\testA\testB\Test1.exe C:\testA\testB\Trigger.jpg",1)
                          '
                          You need to create a script, say test1, that script includes:

                          Code:
                           sys_shell("C:\testA\testB\Test1.exe C:\testA\testB\Trigger.jpg",1)
                          '
                          Then in your OnChange event you have:

                          Code:
                           script_play("test1")
                          '
                          Repeat the process for the others. Create a script for each test2, test3, etc and then in the script_play("test2"), script_play("test3"), etc

                          Later: OR you can

                          Code:
                          select
                          case o_sizes.value = "Test 1"
                          script_play("Name of a script")
                          'or you could have the script itself here (with an end statement, of course)
                          The above would become:

                          Code:
                          select
                          case o_sizes.value = "Test 1"
                          sys_shell("C:\testA\testB\Test1.exe C:\testA\testB\Trigger.jpg",1)
                          Last edited by Cheryl Lemire; 03-16-2008, 08:31 PM. Reason: option to include code instead of script
                          Cheryl
                          #1 Designs By Pagecrazy
                          http://pagecrazy.com/

                          Comment


                            #14
                            Re: Need help how can i add a script to drop down links

                            OK.. One more time:
                            What you just showed is what I described. These are choices for a field in a form,i.e. these are values for that field in a table.

                            If you choose test 1, the value of that field in the table will change to test 1. If you choose test 2, the value will change to test 2 etc.

                            Is that what you want to do? both change the value in the field and run a script? or do you simply want to run script1 if the choice is test1, script2 if the choice is test2 and so on?

                            If you want the latter, there are several ways to do the, the easiest, most convenient, most conventional before getting into the aesoteric, is to create a Custom Toolbar, not to place these values in a field in a table.

                            Comment


                              #15
                              Re: Need help how can i add a script to drop down links

                              I see that, suddenly there is a confluent of responses and too much information overload that is bound to cause you more confusion than clarification, so I will check out.
                              Last edited by G Gabriel; 03-16-2008, 08:53 PM.

                              Comment

                              Working...
                              X