PDA

View Full Version : Posting Search results to HTML Title?


ABC123

seidel1
08-05-2004, 08:54 PM
I have created an A5W page that generates a new page based on a query.

I would like to put the query selection as a title on the created page and than have the rest of the page just contain data. How can I do this or put variables in the freeform edit regions?

Initial Response from Cheryl:

"To accomplish what you want you would need to create a session variable and assign your filter results to that variable. Then you would add that information in your html title tags as shown below:

<%A5 ? alltrim(w_upper(session.fn)) %>"

This makes sense, however, how is this accomplished using the provided A5 dialogs

Thanks in advance,

Jim

Selwyn Rabins
08-06-2004, 06:31 AM
the title tag is defined in the page not in the component.

you can't change the title through a dialog.
you need to edit the page and switch to source view.
you will see the title tag and you can then modify it.

Cheryl Lemire
08-06-2004, 11:21 AM
Hi Selwyn,

Changing the title tag is not where he needs help. He needs to be able to set the option value="fiat" selected which is part of the drop down list control. Unfortunately I have not used the genies/tools/components so I am unable to provide him with the steps as to where to place this code.

Cheryl

Cheryl Lemire
08-06-2004, 11:30 AM
Sorry Selwyn, wrong thread.

Cheryl Lemire
08-07-2004, 07:28 AM
Hi Jim,

The sample html that I gave you is what you put in the title tag to show the value of the session variable that you create:

%A5 ? alltrim(w_upper(session.fn)) %

In my sample I created a session variable fn. This variable is populated based on the user's first name. When a user logs into the application, I open the user table and retrieve their first name to assign to the session variable. I assign my session variables on my login page as found below:

if eval_valid("cmd") then
Query.Description = "check user" 'check for valid user
Query.Filter = "email='" + email + "' .and. pwd='" + pwd + "'" 'this filters the records returned to only show records where the email and pwd fields match the values stored in the variables email and pwd
t = table.open("..\user\user") 'open the user table and assign it to the variable t
idx = t.query_create() 'apply the filter defined by query.filter above
if t.email = email .and. t.pwd = pwd then 'if the email and pwd entered by the user match those fields in the table, then proceed with assigning values to the variables
'valid login info
'assign values to session variables
session.user_num = t.user_num 'assigns the value of what is in the user_num field of the table for the record that matches the user input above to the variable session.user_num
session.admin_level = t.admin_level 'assigns the value of what is in the admin_level field of the table for the record that matches the user input above to the variable session.admin_level
session.fn = t.fn 'assigns the value of what is in the fn field of the table for the record that matches the user input above to the variable session.fn
logged_in = .t.
else 'if the email and pwd entered by the user do NOT match those fields in the table, then proceed with login_error
login_error = "That username/password combination could not be found. Please try again." 'assigns what is in the double quotes to the variable login_error
end if 'end the if/else block
t.close() 'close the user table
end if 'end the if eval_valid block

Hope this helps.
Cheryl