Announcement

Collapse
No announcement yet.

display the status of the inserted record in a message

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

  • display the status of the inserted record in a message

    Hello
    i have a form that insert a record to the database with scriptcase normal behavior, however in the after insert i got a custom many to many insert to another table using 'insert a record on another table' using a loop (foreach).
    my questions :
    1- is there any issue with the method im using ?
    2- is it possible to display the information of the inserted data to a message box, ex" inserting 1 of 20" and in the end the message will be "done" ?

    Thanks

  • #2
    The problem lies in the fact that the browserform does not know about the process in the background. So if you php process is running it can echo a lot, but only afterwards the form is refreshed. There are solutions to this but the most simple way is to let your form refresh automatically and then show status. But it's only useful if you have a lot of timeconsuming transactions. If you only need to insert 20 records, then I don't see the need of a progressbar.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      what if i use ajax to send the data or is it irrelevant?
      i was hoping to do my custom insert in OnBeforeInsert and get the result and show it in a massage in OnAfterInsert, is it possible ?
      other question : how can i add a button next to a field ?

      Comment


      • #4
        You can only add buttons to a form, not to a field. What you want to achieve is not a Scriptcase or PHP issue, it's a html issue. The webserver has displayed you the page. Then the client (javascript) needs to inform the server about status or to start up the next update. In other words, the initiative is on the client, not on the server. That's why you cannot easily achieve this. It's inherent to webapplications.

        But you can use ajax to send a message to be informed about the status of something and then display the data in your form w.o. full reloading the page. But then again, you need to refresh this on the client side by javascript.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Thanks aducom
          i think its nearly impossible then.
          i want to add a button next to autocomplete text and make that button capture the selected record id and save it to a variable.
          the problem is i can't add a button next to the desired field, but i see in one of the security application a button next to the field email that will send an email to the user.

          Comment


          • #6
            Originally posted by mohammad View Post
            Thanks aducom
            i think its nearly impossible then.
            i want to add a button next to autocomplete text and make that button capture the selected record id and save it to a variable.
            the problem is i can't add a button next to the desired field, but i see in one of the security application a button next to the field email that will send an email to the user.
            Yes, if the field is of type email you can enable this button. But that's something different.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment

            Working...
            X