Alpha Video Training
Results 1 to 19 of 19

Thread: Passing Data

  1. #1
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default Passing Data

    I have created a questionaire and upon submit I redirect to an a5w THANKS page. On this page I have xbasic to send an email to myself letting me know that someone has submitted a questionaire. It is working fine but thought I would try to make the email a little more data specific.

    On the questionaire page I have two fields NAME and EMLADDRESS. I want to pass this data to the THANKS page to be included in the MESSAGE portion of the email. Here is my target page

    http://www.azenta.com/azwebqst/azwebqthanks.a5w?f1=name&f2=emladdress

    On my THANKS page I have the following code for the email message:
    pm.message = f1+" - "+f2+" has submitted feedback"

    When I receive the email I get
    name - emladdress has submitted feedback

    How do I get the email to recognize data in the respective field?

    Thanks

  2. #2
    VAR Pat Bremkamp's Avatar
    Real Name
    Pat Bremkamp
    Join Date
    Apr 2000
    Location
    Oregon, USA
    Posts
    2,645

    Default RE: Passing Data

    Philip,

    In another thread, Lenny responds:

    In your grid, you would build a link something like
    page2.a5w?fname={fname}&lname={lname}

    So, I think you just have to add the curly brackets { }

    Pat

  3. #3
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Unfortunately that's not the answer, now the email displays:
    {name} - {emladdress} has submitted feedback

    Thanks

  4. #4
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    The problem is that (I sassume) you have this as a single quoted string:
    "http://www.azenta.com/azwebqst/azwebqthanks.a5w?f1=name&f2=emladdress"

    As a result, the browser is redirected to eaxctly what you've quoted. To instead pass the values of those 2 variables, you would use:

    Code:
    "http://www.azenta.com/azwebqst/azwebqthanks.a5w?f1=" + name + "&f2=" + emladdress

  5. #5
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    Pat, that is the correct syntax to be used if you are creting a link control in a grid. But I don't think that is what Philip is doing. {fname} and {lname} have no meaning outside of the grid component itself.

  6. #6
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Lenny, Still have a problem. I had abbreviated the url earlier to make it short. Here is what the actual target page is:
    http://24.172.140.23/azenta/azwebquestionaire/azwebqthanks.a5w?"f1=" + name + "&f2=" + emladdress

    Here is the error I now get when opening the thanks page:
    Script Error
    Error:Script: /azenta/azwebquestionaire/azwebqthanks.a5w line:54
    pm.message = f1+" - "+f2+" has submitted feedback"
    Variable "f1" not found.

  7. #7
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    You have your quoting wrong. Why don't you show me the complete line of code that contains this URL and I will help you get it properly quoted.

  8. #8
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Here is the code for the target page and the thanks page for the email.
    ------------------------------------------------------
    Target Page From Grid Parameters

    http://24.172.140.23/azenta/azwebquestionaire/azwebqthanks.a5w?"f1=" + name + "&f2=" + emladdress

    ------------------------------------------------------
    Email Code in the THANKS page
    "%a5
    DIM ps as P
    DIM pm as P

    pm.from = "phil@ferrastone.com"
    pm.from_alias = "AZ Feedback Page"
    pm.to = "sales@azenta.com"
    pm.cc = ""
    pm.bcc = ""
    pm.subject = "Response From Feedback Page"
    pm.message = f1+" - "+f2+" has submitted feedback"
    ' send message

    IF email_smtp_open(ps, "mail.ferrastone.com")
    email_smtp_send(pm, ps)
    END IF
    Email_smtp_close(ps)
    %"

  9. #9
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    I had misunderstood where you were drfining the URL, which is why I had asked you to post the com,plete line. I did not realize this was somwething you were specifying in the Target page property under Update Settings. Using variables like this is not possible in the grid builder.

    But you can still do what you want. Open the A5W page that has your component in the HTML Editor and switch to Source mode. Then add the following code anywhere after "delete tmpl" and before "a5w_run_component(..."

    if eval_valid("YourComponentName_Button_Submit")
    tmpl.edit.TargetPage = "http://24.172.140.23/azenta/azwebquestionaire/azwebqthanks.a5w?f1=" + V.R1.NAME + "&f2=" + V.R1.EMLADDRESS
    end if

    In the above, replace "YourComponentName" with the name of your component.

    -Lenny

  10. #10
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Lenny, still coming up with the error of not finding variable.
    500 Internal Server Error
    Script Error
    Error:Script: /nksoa/ussf/ussfregisterthanks.a5w line:35
    pm.message = F1+"Someone has submitted registration for a USSF clinic"
    Variable "F1" not found.


    --------------------------------------------------------------------------------

    Alpha Five Web Application Server/6.0 Build/1555 at ALPHASERVER Port 80

    I have attached a file showing the REGISTRATION a5w page and the THANKS a5w page. I am at home right now and the path is different from what I have had in previous threads, but the code is the same. I have indicated in RED the lines of code that I have added per your advice and where the code is that V6 is finding the error.

    Thanks

  11. #11
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    Your a5w page uses "tmpl_ussfregister" instead of "tmpl" that I used in my sample code. Replace the code I gave you previously with:

    if eval_valid("ussfregister_Button_Submit")
    ussfregister.edit.TargetPage = "http://24.172.140.23/nksoa/ussf/ussfregisterthanks.a5w?F1=" + V.R1.FIRSTNAME + "&F2=" + V.R1.EMAILADDRESS
    end if

  12. #12
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Thanks a5w still not finding f1 or f2, here is the code that I placed on the questionaire page. I added some of the extra code so you can see where I placed the code you wanted me to add:

    "%a5
    Delete tmpl_azwebquestionai
    DIM tmpl_azwebquestionai as P

    tmpl_azwebquestionai = a5w_load_component("azwebquestionaire")

    if eval_valid("azwebquestionaire_Button_Submit")
    azwebquestionaire.edit.TargetPage = "http://24.172.140.23/azenta/azwebquestionaire/azwebqthanks.a5w?f1=" + V.R1.NAME + "&f2=" + V.R1.EMLADDRESS
    end if

    'Following code.......

  13. #13
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    It needs to be

    if eval_valid("azwebquestionaire_Button_Submit")
    tmpl.azwebquestionaire.edit.TargetPage = "http://24.172.140.23/azenta/azwebquestionaire/azwebqthanks.a5w?f1=" + V.R1.NAME + "&f2=" + V.R1.EMLADDRESS
    end if

  14. #14
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Lenny, I copied and pasted your code to make sure there were no errors and I got the following:

    500 Internal Server Error
    Script Error
    Error:Script: /azenta/azwebquestionaire/azwebqthanks.a5w line:54
    pm.message = f1+" - "+f2+" has submitted feedback"
    Variable "f1" not found.

    Is the problem with this line...?

  15. #15
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    OK, instead of all this back-and-forth, can you send me your pages, component and any tables they need?

  16. #16
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    Just to update anyone else curious to see what happens here: Philip sent me his pages and I sent him the solution. It was just a matter of fixing a couple of typos that got introduced from the back-and-forth posting of code snippets. When I was able to see his actual code with the correct variabl names, the actual technique was still the same.

    -Lenny

  17. #17
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    Thank you Lenny, I received the email as well. I do have one question after seeing the change that you made. The name of the component was "azwebquestionaire", however you changed it to "azwebquestionai" does V6 truncate to 15 characters?

    Once again thank you....

  18. #18
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,701

    Default RE: Passing Data

    It's not actually the name of the component that was changed. Loading the component creates a pointer and your A5W page has:

    DIM tmpl_azwebquestionai as P
    tmpl_azwebquestionai = a5w_load_component("azwebquestionaire")

    I have no idea where that name came from, that's what was in your A5W page so I stuck with it. When you insert a compoennt in a page, it just uses "tmpl" by default. You may change it to anything you wish and the length is not limited. You just need to be sure to use this name consistently in your code, which I was not doing when I posted some code snippets above.

    -Lenny

  19. #19
    "Certified" Alphaholic Phil Rolf's Avatar
    Real Name
    Philip Rolf
    Join Date
    Apr 2000
    Location
    Kentucky
    Posts
    1,539

    Default RE: Passing Data

    I know I had seen that shortened name before. I created a new page and inserted the component azwebquestionaire and you can see from the JPG that the code is including the alias. That is where the confusion is coming from.

Similar Threads

  1. passing data after add in grid
    By rlgiordano in forum Web Application Server v6
    Replies: 0
    Last Post: 06-20-2005, 05:48 AM
  2. Passing Data From a Form to Script
    By Gregory R. Zilliox in forum Alpha Five Version 5
    Replies: 6
    Last Post: 03-11-2004, 01:44 PM
  3. passing data between subform and parent
    By Scott Emerick in forum Alpha Five Version 5
    Replies: 3
    Last Post: 08-13-2002, 04:21 AM
  4. Passing data in field to another app
    By Tim Sutherland in forum Alpha Five Version 4
    Replies: 1
    Last Post: 01-25-2002, 04:36 PM
  5. Basic Data Entry & passing global Tom Cone
    By Don Reed in forum Alpha Five Version 4
    Replies: 1
    Last Post: 09-22-2001, 06:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •