Clear a text field based on another fields value

K

Knedd

I am try to clear a text field (or return it to teh default value) based on
another field.

SENARIO: user selects a city from drop down. set of field are 'unhidden'
and user begins to complete revealed fields. then user changes mind and goes
back selects another city. so a different set of fields are 'unhidden' and
user completes those fields.

I need to clear the previously entered information so that it will not be
sent to the database. I figure I can create some rules that amount to: if
field(city) is equal to any other city then clear this field or reset it or
set to default. I can see how to do this for a number field but I figure out
how to do it for a text field. Any suggestions?
 
S

S.Y.M. Wong-A-Ton

Is the value of an item in the drop-down the same as its display name? If
not, checking a text field against a display name won't work, since the value
of a drop-down item is used. If you are checking against display names in a
drop-down list box, you need to make sure that the values in the drop-down
list box are the same as the display names.
 
K

Knedd

It is not the value of the drop down that I would like to clear, but I would
like to clear "unhidden" fields that the user began to fill-in. so if the
user selects Philadelphia in the drop down and the fields for the
Philadelphia are revealed and the user begins to complete those fields then
changes his mind and decides to goto Balitmore and the Baltimore fields are
revealed and the user completes those and submits the form--the database will
still have the partically completed Philadelphia information. What I need to
happen is anytime the user selects a city all of the detail fields for the
cities are cleared to make sure we don't get extra info in the database.
 
S

S.Y.M. Wong-A-Ton

I'm not saying that you should clear the value of the drop-down. I'm just
asking whether the value of each item in the drop-down is the same as its
corresponding display name.

You need to set rules with conditions on the drop-down. Example for
Baltimore: Create a rule on the drop-down that will set the text fields for
Baltimore to an empty string. Then create a condition for this rule that
says: Selected value of drop-down is not equal to Baltimore. This will let
the rule only run when the value in the drop-down is something other than
Baltimore and thus will clear the text fields for Baltimore.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top