I have One Numeric Field for PostCode and one drop down list for city.
I want when i write the PostCode in Numeric Field to show automaticly the city in Drop Down list.
And same when I chose to Drop Down list then to show in Numeric Field (PostCode)
I have all that in Excel.
Thank you
Solved! Go to Solution.
Views
Replies
Total Likes
Use dynamic properties.
First export the xml from your excel spreadsheet (you're on your own with that one). Assuming each row is a city and a postal code, your xml should look like this:
<Root>
<Row>
<City>SomeCity</City>
<PostalCode>12345</PostalCode>
</Row>
.
.
.
1) In Designer, go File>New Data Connection...
2) Select Sample XML Data and the file from Excel.
3) Make sure dynamic properties are enabled, Tools>Options>Data Binding>Show Dynamic Properties.
4) Select your drop down and open the Field tab under the Object Palette.
5)You'll notice List Items is green and underlined. Select it.
6) For Items, select Row
7) For Item Text, select City
8) For Item Value, select PostalCode
You now have your drop down bound to the data from your Excel spreadsheet.
Now, just a bit of coding (hang in there), in the numeric field for your postal code, in the exit event put:
theDropDown.rawValue=this.rawValue;
and for theDropDown put:
thePostalCode.rawValue=this.rawValue;
Now all you have to do is import the xml into your form at runtime.
Kyle
Views
Replies
Total Likes
Hi,
On the exit event of the numberic field you need to capture the value of the numeric field and using switch case you need to update the drop down.
below is the sample script.
switch (this.rawValue) {
case "postal1":
dropdown.rawValue = "City1";
break;
case "postal2":
dropdown.rawValue = "City2";
break;
case "postal3":
dropdown.rawValue = "City3";
break;
default:
dropdown.rawValue = "default city";
break;
}
But you need to create the dropdown with all the city name before scripting.
You need to follow the same scripting for the next task also.
Thanks
Vjay
I must to do this for every city?
Because I have 5500.
Views
Replies
Total Likes
Use dynamic properties.
First export the xml from your excel spreadsheet (you're on your own with that one). Assuming each row is a city and a postal code, your xml should look like this:
<Root>
<Row>
<City>SomeCity</City>
<PostalCode>12345</PostalCode>
</Row>
.
.
.
1) In Designer, go File>New Data Connection...
2) Select Sample XML Data and the file from Excel.
3) Make sure dynamic properties are enabled, Tools>Options>Data Binding>Show Dynamic Properties.
4) Select your drop down and open the Field tab under the Object Palette.
5)You'll notice List Items is green and underlined. Select it.
6) For Items, select Row
7) For Item Text, select City
8) For Item Value, select PostalCode
You now have your drop down bound to the data from your Excel spreadsheet.
Now, just a bit of coding (hang in there), in the numeric field for your postal code, in the exit event put:
theDropDown.rawValue=this.rawValue;
and for theDropDown put:
thePostalCode.rawValue=this.rawValue;
Now all you have to do is import the xml into your form at runtime.
Kyle
Views
Replies
Total Likes
Views
Likes
Replies