NetTalk Central

Author Topic: How to set a field from upload  (Read 1920 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1861
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to set a field from upload
« on: March 04, 2009, 03:50:29 AM »
Hi,
I have a form with Description and a File Upload.
If the user does not filled the Description field I need the Description be equal to the Original File field, I said original because I´m changing the path & filename in the WebHandler.

I´ve tried to add
 IF PIC:DESCRIPTION=''
   PIC:DESCRIPTION = PIC:FILE
 END

In the Validate of the PIC:FILE and reset the PIC:Description and nothing happens.

How can I do it?

Thanks
Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11204
    • View Profile
Re: How to set a field from upload
« Reply #1 on: March 04, 2009, 09:17:19 AM »
the validate::pic:file routine only gets called "dynamically" when the user enteres something in pic:file, not on the Save button.

If you want to assign something here, you need to assign the session variable.
ie
IF p_web.gsv('PIC:DESCRIPTION')=''
   p_web.ssv('PIC:DESCRIPTION',PIC:FILE)
 END
also you'll want to "reset" the Pic:Description field on the Pic:File field.

Cheers
Bruce