NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan de Klerk on October 08, 2023, 01:13:13 AM

Title: How to change Prompt Text and ToolTip in Code
Post by: Johan de Klerk on October 08, 2023, 01:13:13 AM
Hi,

I need to change the Prompt Text and ToolTip in code depending on conditions.

If p_web.GSV('Option') = 1
    PromptText = 'Select Option 1:'
    ToolTip = 'This will give you the Customer Report'
ELSIF p_web.GSV('Option') = 2
    PromptText = 'Select Option 2:'
    ToolTip = 'This will give you the Invoices Report'
ELSIF p_web.GSV('Option') = 3
    PromptText = 'Select Option 3:'
    ToolTip = 'This will give you the Orders Report'
ELSE
    PromptText = 'No Option Selected:'
    ToolTip = 'Please Select a option for the Report'
END

Any help would be appreciated.

Regards

Johan de Klerk
Title: Re: How to change Prompt Text and ToolTip in Code
Post by: Vinnie on October 08, 2023, 03:04:37 AM
Prompt and Tips are Session Values

Prompt = 'abcde'
SetSessionValue('Prompt ',Prompt)

And the Prompt is a session value

p_web.GetSessionValue('Prompt')
Title: Re: How to change Prompt Text and ToolTip in Code
Post by: Johan de Klerk on October 08, 2023, 09:08:04 PM
Hi Vinnie,

Thanks for the reply.

My field name is Rep:WhichReport
This is one of many fields on my NetWebForm.

I only want to change the Prompt Text and ToolTip for this one field on the form.

Regards

Johan de Klerk
Title: Re: How to change Prompt Text and ToolTip in Code
Post by: Vinnie on October 08, 2023, 10:41:37 PM
Hi

In your Code

p_web.SetSessionValue('Rep:WhichReportPrompt','What you want the prompt to be')
p_web.SetSessionValue('Rep:WhichReportTip','What you want the tip to be')


Form Fields

Field  Rep:WhichReport
Equate Rep:WhichReport
Prompt p_web.GetSessionValue('Rep:WhichReportPrompt')
ToolTip p_web.GetSessionValue('Rep:WhichReportTip')

Title: Re: How to change Prompt Text and ToolTip in Code
Post by: Johan de Klerk on October 09, 2023, 02:49:36 AM
Hi Vinnie,

Thank you very much.

It works perfect.

Regards

Johan de Klerk