NetTalk Central

Author Topic: Dynamically Format Picture in NetWebForm  (Read 3478 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Dynamically Format Picture in NetWebForm
« on: October 28, 2008, 04:21:17 AM »
Hi,

How can I dynamically format a field in NetWebForm, example

Field Name        Format

Name
Surname
Date of Birth        @d6
Address
Postal Code        @n04
Gender
etc

I have numerous records in a file with a sort of layout above (questionnaire like), where a field will only populate if there is a value in.  However, sometimes I need a date or number or other format, which in Clarion I will do

?Q:Fieldname:prompt{prop:text} = L:Fieldname
if clip(L:FieldnameFormat) <> ''
    ?Q:Fieldname{prop:text} = clip(L:FieldnameFormat)
.

I tried to put this variable in the Picture field in the Settings Tab when defining a field, but it behaves irregularly.

Although it remembers the right date, when opening the data file again it displays the date as 9/01/1801 which I guess must be date number 0 or 1.

Any ideas please??

Cheers

Charl

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Dynamically Format Picture in NetWebForm
« Reply #1 on: October 28, 2008, 10:17:12 PM »
Hi Charl,

So it works, except for the date field?
Or does it generally fail on all fields?

My guess would be that you'd want to set the picture to be a Session Value - not just the field value.

ie

p_web.GSV('DateOfBirthFormat')

I'm not 100% sure where you're getting the format from, but you may need to push it into the session Queue in the GenerateForm routine.
p_web.SSV('DateOfBirthFormat',fil:dateOfBirthFormat)

cheers
Bruce