This topic is locked
[SOLVED]

 Fast entry of default values

5/15/2010 12:02:49 AM
PHPRunner General questions
T
tabonjing author

Hello Admin,
Issue: Fast data entry using default values in the Add New page.
This is the existing Help guide technique about setting default values to facilitate data entry:

  1. Create session variable upon successful login:

    $_SESSION["campuslocation"] = "General Santos City";
  2. Before record added event

    $values["campuslocation"] = $_SESSION["campuslocation"];
  3. the user hits the SAVE button
    This approach is good but not informative enough since the user did not see on screen the field campuslocation being assigned the value General Santos City.
    What I want:
  4. Create session variable upon successful login:

    $_SESSION["campuslocation"] = "General Santos City";
  5. Make the field campuslocation as readonly on the ADD Page with the preassigned Value General Santos City so that the user can see but cannot change the value.
  6. Before record added event

    $values["campuslocation"] = $_SESSION["campuslocation"];
  7. the user hits the SAVE button
    I think the idea of letting the user see all fields with corresponding value before hitting the SAVE button adds completeness to the process of entering data in a network environment. Any idea on how to do this? I tried to figure it out but I was not successful.
    Best regards,
    Frodnicklye

T
tabonjing author 5/15/2010

It's allright. I managed to solve the problem
I created the following codes in the Add page before display event
global $readonlyfields;

$rs = CustomQuery("select location from tablelocation where counter = " . $_SESSION["locationid"]);

$data = db_fetch_array($rs);

$readonlyfields["campuslocation"] = $data["location"];



Hello Admin,
Issue: Fast data entry using default values in the Add New page.
This is the existing Help guide technique about setting default values to facilitate data entry:

  1. Create session variable upon successful login:

    $_SESSION["campuslocation"] = "General Santos City";
  2. Before record added event

    $values["campuslocation"] = $_SESSION["campuslocation"];
  3. the user hits the SAVE button
    This approach is good but not informative enough since the user did not see on screen the field campuslocation being assigned the value General Santos City.
    What I want:
  4. Create session variable upon successful login:

    $_SESSION["campuslocation"] = "General Santos City";
  5. Make the field campuslocation as readonly on the ADD Page with the preassigned Value General Santos City so that the user can see but cannot change the value.
  6. Before record added event

    $values["campuslocation"] = $_SESSION["campuslocation"];
  7. the user hits the SAVE button
    I think the idea of letting the user see all fields with corresponding value before hitting the SAVE button adds completeness to the process of entering data in a network environment. Any idea on how to do this? I tried to figure it out but I was not successful.
    Best regards,
    Frodnicklye