Alpha Video Training
Results 1 to 7 of 7

Thread: update filed value and redirect

  1. #1
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default update filed value and redirect

    im just kind of getting in to coding .a5w pages and im hoping for a little guidance.

    i have a grid with just a couple of fields, i need a user to set the value of a field (yes or no), based upon the value i need to update another field in the grid and then redirect to a page.

    the redirects are working but i am neeidng to press the submit button twice.

    Code:
    function CanUpdateRecord as v (DataSubmitted as P, Args as p, PageVariables as p, Result as p )
    with PageVariables
    Result.Cancel = .f.
    Result.ErrorHTML = ""
    select
        case DataSubmitted.Clientanydependents ="Yes"
    		DataSubmitted.Comp_dependents = "Not Done"
    end select
    select
        case DataSubmitted.Clientanydependents="No"
    		DataSubmitted.Comp_dependents="Done"
    end select
    if Args.DataSubmitted.R1.Clientanydependents= "Yes" then
      Response.Redirect("mmo_dependents.a5w")
      end 
    elseif Args.DataSubmitted.R1.Clientanydependents= "No" then
     response.redirect("mmo_nodependents.html")
    end if
    end with
    end function
    ive got to be honest and say im stumbling through it.

  2. #2
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: update filed value and redirect

    Bump -

    could any one please help with this one.

    all i really need to know is how do i update a hidden field in a record and redirect to another page based upon the value of another field in the same record selected by a user.

    to simplify -

    user selects a value from field 1 (choices - yes, no)
    user clicks submit button
    code needs to run to 1. update a hidden field value and 2. redirect to a page - both of these dependent upon the user selected value

    im almost there, and cant seem to get any further with the help files.

  3. #3
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: update filed value and redirect

    Maybe the reason you have to press the Submit twice is you put your code in the UpdateEvent. If they are saving a brand new record, then put the same code in the BeforeValidateNewRecords. Try that first.

    Updating a hidden field should work as long as the field is updatable. The best way is to make your field a normal TextBox and make sure it is updateable, then toggle it to Hide Row and Hidden.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  4. #4
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: update filed value and redirect

    steve,

    the record is not a new record as this is just part of a record that has already been worked on in a different page.

    i have ensured the hidden field can be updated (is editible). it is updating but in a adhoc manner (it seems to update from the previous submit not the current submit).

    the page redirects are working fine but i do sometimes have to press the submit button twice.

  5. #5
    Volunteer Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,842

    Default Re: update filed value and redirect

    Copy the grid up here.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  6. #6
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: update filed value and redirect

    thanks steve,

    ill do it tonight as its at home.

  7. #7
    "Certified" Alphaholic richard2007's Avatar
    Real Name
    Richard Harris
    Join Date
    Sep 2007
    Location
    Ashford, Kent, UK
    Posts
    1,095

    Default Re: update filed value and redirect

    web component attached.

Similar Threads

  1. \ being stripped from filed
    By Atta in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 01-08-2009, 12:37 AM
  2. Time Filed not displayin properly
    By mmaisterrena in forum Application Server Version 9 - Web/Browser Applications
    Replies: 4
    Last Post: 05-23-2008, 05:03 AM
  3. Filed Validation for Dates
    By Howard G. Cornett in forum Web Application Server v6
    Replies: 4
    Last Post: 10-02-2005, 04:11 PM
  4. Reaching a Max No in filed
    By John Burke in forum Alpha Five Version 5
    Replies: 3
    Last Post: 04-18-2005, 11:31 PM
  5. Filed Values into Veriables?
    By Keith Hubert in forum Alpha Five Version 5
    Replies: 7
    Last Post: 01-09-2003, 12:57 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
  •