NetTalk Central

Author Topic: FORM: setting values based on a change in a drop down  (Read 5330 times)

mriffey

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
FORM: setting values based on a change in a drop down
« on: August 02, 2007, 11:21:33 PM »
I have webform that has a drop down on it.

Drop down is state code. State file has a country field on it. Country name is coming back properly when state code is selected.

There is a country table as well. For whatever reason, this code has countrytable:countryfield on the form - even though the table being updated is the customer table (which oddly enough has no country field).

Clear as mud, right?

I have the statetable:statecode field set to reset the countrytable:countryfield field when it changes.

Mostly due to LPS, in the countrytable:countrynamefield value routine, i do a countrytable:countrynamefield = statetable:countrynamefield (and Ive confirmed that the statetable:countrynamefield field has the proper data in it).

BUT, the countrytable:countrynamefield on the form (displayed) NEVER has any text in it.

This occurs whether countrytable:countrynamefield is marked on the form as read only, or not.

I know, confusing. I inherited it (several times a day, in fact) and Im trying to get it to work the way it is.

A) is that a pipe dream
B) what'd I miss here re: displaying that field?

thanks,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: FORM: setting values based on a change in a drop down
« Reply #1 on: August 03, 2007, 03:41:49 AM »
Hi Mark,

I confess that I didn't follow much of your explanation.
However the crux of the question is
"I update the drop down and the display field doesn't update" - right?

If so there are really only a few things to check.

a) Remember that any changes you make here apply to the _session value_. So if you wind up setting
whatever = 5
then you must remember to set
p_web.SSV('whatever',5)

b) Perhaps the value is updated, but not "sent". Look in the generated source, in the Validate::dropfield routine. You should see your embed code (which happens when the field changes) under that you should see
do Value::OtherField
where Otherfield is the field you're expecting to update. If it's not there then add it to the Client-Side tab (of DropField) to the Resets list.

c) remember that in this embed point files have _not_ been opened for you. If you are doing any file access code put
Access:File.Open() etc.

Cheers
Bruce

mriffey

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
Re: FORM: setting values based on a change in a drop down
« Reply #2 on: August 03, 2007, 07:18:36 AM »
Why yes, that explanation DID kinda smell funny:)

I wasnt setting the session value, the rest was done as you directed. Sleep is a wondrous thing:)

Thanks Bruce.

Mark