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

Javascript Message Box not working

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

    Javascript Message Box not working

    Hello All

    Currently trying to learn how to use Javascript message boxes as part of my web app. In short, I have a dialog component inserted into a web page. On the web page, I have the following code inserted in the head of the html:


    Code:
    <script language="javascript">
    function MsgBox (textstring){alert(textstring)}
    </Script>
    Then, within the After Validate Event within the dialog component, I have the following code:

    Code:
    a5ws_get_user_values(CurrentForm,request)
    msgbox("Add New User","You are now a registered user of CDIS",UI_OK)
    The first line is unrelated to the message box, but thought I would include just in case. Lastly, when I click on the submit button to add another user to the system, I am getting the following message:

    Errors in: event.AfterValidate code:
    Result stack underflow

    Has anyone come across this? This is the third error I have encountered (have managed to sort the first two), so if anything looks incorrect, please let me know

    Many thanks

    Jason

    #2
    Re: Javascript Message Box not working

    Hi Jason,
    Javascript is normally executed on the client so you cannot execute it directly from a server side event.
    With v10 you can send a javascript response from some of the serverside events. e.g. AfterUpdateRecord via e.rtc.A_AjaxResponse
    Not sure if v9 has similar.
    https://appsbydesign.co.uk/

    Comment


      #3
      Re: Javascript Message Box not working

      http://afas.alphasoftware.com/Sample...pupWindows.a5w
      That link doesn't work for me any more

      But try the samples
      Web Application Demos -> AJAX_PopupWindows.a5w

      Sorry, but I don't see how your way will work. :-(

      Comment


        #4
        Re: Javascript Message Box not working

        Hi Colin & Colin

        Many thanks for your replies! Ok, I understand what you are saying re the javascript running on the client, I should have thought of that

        I checked the AJAX popup windows in the Web Demos dbase, the a5_msg_box command looks good, but I'm struggling to understand where I would place it because I cant insert the code in the server events in the dialog, and there is only one client event which is validate before submit. How do I link the a5msg_box command to the submit command?

        Cheers

        Jason

        Comment


          #5
          Re: Javascript Message Box not working

          Well with a name like yours, you should be a whiz at AJAX
          -
          Anyhow
          one trick to firing javascript is via using the eval_valid,
          Note: This is done on the web page that holds the component, not in the component.
          -
          One way to uderstand what the A5-server does is to compare what goes in as in a5 format to what is created as a5w/html code.
          Please check the zip.

          Comment


            #6
            Re: Javascript Message Box not working

            If only Colin....if only

            OK many thanks for taking time out to send a demo. I got it working, but I'm trying to understand what is going on. Are these lines of code

            Code:
            <script type="text/javascript" src="Javascript/core.js"></script>
            <script type="text/javascript" src="Javascript/aui.js"></script>
            <script type="text/javascript" src="Javascript/AjaxFormLibrary.js"></script>
            <script type="text/javascript">
            essentially making the a5w page 'javascript capable'?

            From there it seems like you have declared a function called msgBoxer, and that once the eval_valid is true, it calls the message text from within the function.

            Re this line of code

            Code:
            ?"<script type=\"text/javascript\" > msgBoxer(\"Hush\"); </script>"
            I dont understand how this works by saying that ]?"<script type=\"text/javascript\" is greater than msgBoxer(\"Hush\"); </script>"

            What exactly does \"Hush"\ do? Does this turn the message off?

            Just lastly if I can hit you with one more question, how do I adjust the code to only show the confirm message once the page has been validated? You have Dim L as L with the after validate component event, not sure how that ties in? At the moment, if the end user enters incorrect information, the pop up message appears and then it shows the validation error straight after

            Sorry for the many questions, just trying to understand rather than just copy and paste, hopefully it will minimise the number of javascript questions I need to raise in the future

            Cheers

            Jason

            Comment


              #7
              Re: Javascript Message Box not working

              Yes,
              The <javascript lines> Make the page capable of using javascript and most (maybe all ) of of the A5 javascript library of functions .
              --
              Ok eval_valid in this context is processed by the A5 server, but is not executed until the submitButton is pressed.

              OK Hush is just a dummy string that I have used, you could have any value that is passed through to the function. eg a message, "submitButton has been pressed".
              ---
              Dim L as L -- Apologies I should have deleted that, it was for siomething else I was trying.
              --
              Ok- The Aftervalidate event is called when "All the data has been considered as valid.
              I would call it "Submit now"
              -
              When Version 10 is released I expect that all this javascript stuff will be much easier, currently it is really a lot of workarounds.
              -
              Now that you can call a javascript function, you should be able to change the function to do anything you wish.
              -
              A problem currently is that when the page is refreshed and resubmitted the function will fire, although the submit was not pressed. To fix this you will need to have a variable initialized and set in the initialize event and test that variable in the eval_valid to see if it is valid also.

              Comment


                #8
                Re: Javascript Message Box not working

                thanks Colin. I'll try and build my knowledge in the world of Javascript

                Jason

                Comment

                Working...
                X