NetTalk Central

Author Topic: How to change Prompt Text and ToolTip in Code  (Read 3007 times)

Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
How to change Prompt Text and ToolTip in Code
« 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
« Last Edit: October 08, 2023, 01:58:53 AM by Johan de Klerk »
Clarion 10, NT 11.57

Vinnie

  • Full Member
  • ***
  • Posts: 183
    • View Profile
    • Email
Re: How to change Prompt Text and ToolTip in Code
« Reply #1 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')

Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to change Prompt Text and ToolTip in Code
« Reply #2 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
Clarion 10, NT 11.57

Vinnie

  • Full Member
  • ***
  • Posts: 183
    • View Profile
    • Email
Re: How to change Prompt Text and ToolTip in Code
« Reply #3 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')


Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: How to change Prompt Text and ToolTip in Code
« Reply #4 on: October 09, 2023, 02:49:36 AM »
Hi Vinnie,

Thank you very much.

It works perfect.

Regards

Johan de Klerk
Clarion 10, NT 11.57