I need help on a strategy for resolving a difficulty. I'll explain in terms of a very simple example that, when solved, I'll be able to apply to the real project.
My objective:
I have a grid with two fields ("Question" and "Details").
The field "Question" has a radio button control, with a static choice of "Yes" or "No."
The field "Details" has a text box control. The default setting for the Column.Hide property of the field "Details" is true (.t.).
So, when the .a5w page first loads, the user is presented with a single row containing the field "Question" and a Yes/No radio button choice. At this point the field "Details" is hidden since its Column.Hide property is set to true.
Desired Behavior:
In the CanInsertRecord event I code a simple if-then-else test that checks for a "Yes" answer submitted for the field "Question." If the user selected "Yes" then the Column.Hide property for the field "Details" is set to false.
If the if-then-else test finds that "Yes" was selected for the field "Question" I then want the page to refresh (with the original radio button selection retained) so that both the "Question" field and the "Details" field are visible. In other words, I want the user to be given a text box to provide details of why they answered "yes". If they answered "no" then the .a5w page simply redirects to the next page in the sequence as set in Update Settings > Target Page.
The Issue:
My coding in the CanInsertRecord event has produced the desired result of having the "Details" field appear if "Yes" was selected by the user. BUT, when this happens, the "Question" field does not retain the "Yes" selection. In other words, if the user originally selected "Yes" I want them to provide details without having to once again select "Yes" in the field "Question."
So far, I have attempted to accomplish this by having the CanInsertRecord event redirect to <self>. I have also tried having the CanInsertRecord event redirect to another .a5w page and pass the DataSubmitted values in the form of variables included in the redirecting URL. Nothing has worked.
Any strategies or directions you could provide to guide me in achieving this would be greatly appreciated. Thanks.
My objective:
I have a grid with two fields ("Question" and "Details").
The field "Question" has a radio button control, with a static choice of "Yes" or "No."
The field "Details" has a text box control. The default setting for the Column.Hide property of the field "Details" is true (.t.).
So, when the .a5w page first loads, the user is presented with a single row containing the field "Question" and a Yes/No radio button choice. At this point the field "Details" is hidden since its Column.Hide property is set to true.
Desired Behavior:
In the CanInsertRecord event I code a simple if-then-else test that checks for a "Yes" answer submitted for the field "Question." If the user selected "Yes" then the Column.Hide property for the field "Details" is set to false.
If the if-then-else test finds that "Yes" was selected for the field "Question" I then want the page to refresh (with the original radio button selection retained) so that both the "Question" field and the "Details" field are visible. In other words, I want the user to be given a text box to provide details of why they answered "yes". If they answered "no" then the .a5w page simply redirects to the next page in the sequence as set in Update Settings > Target Page.
The Issue:
My coding in the CanInsertRecord event has produced the desired result of having the "Details" field appear if "Yes" was selected by the user. BUT, when this happens, the "Question" field does not retain the "Yes" selection. In other words, if the user originally selected "Yes" I want them to provide details without having to once again select "Yes" in the field "Question."
So far, I have attempted to accomplish this by having the CanInsertRecord event redirect to <self>. I have also tried having the CanInsertRecord event redirect to another .a5w page and pass the DataSubmitted values in the form of variables included in the redirecting URL. Nothing has worked.
Any strategies or directions you could provide to guide me in achieving this would be greatly appreciated. Thanks.
Comment