CountrySelect form field, pre-populate with a country - intershop

How can I default to populating the Select drop down list with a value, in this case it would be the country U.S.. We've removed other countries from the list but users are still required to select the one option.
In addition to a default value, the dependent fields would need to be populated. Currently in Intershop, selecting the country populates the State field. I would like to default to U.S. and have the State field already populated on the initial request, sans ajax calls.

You would have to modify some pipelines for this.
The webform it loads is based in the country code. Intershop gets the countrycode from the addressbo or as a parameter. See the ViewUserAccount-ChangeAddress : this pipeline is used in the ajax request to load the webform when u select a country. You could use the same logic to load the U.S webform (US) when the address has not been filled in yet.

Related

How to print Activiti workflow task's values into Alfresco Share

I have a workflow to manage employee petitions, that starts with some fields at starter form. The next task, allows a responsable user to approve or reject the initiator user's petition.
I want to show the values of starting form into the approve/reject form, so I created a custom .ftl file for every field that I want print the label and the value. Now I have hard-coded the values to the this:
My problem here, is how to get the value from the first form and print it at the second form (values that I need are where says "200€" and my name).
I'm using Alfresco Community 5.1 and his own Activiti.
Thanks.
Solution 1 : keep IDs of the fields identical in both the forms. this will make the field editable in the second form.
Solution 2 : create a process variable, set its value after the first form has been submitted. then, in the second form display the value of the process variable.

Attaching AJAX to Drupal Forms API Date Field

I am developing a Drupal form which includes a Date field.
I have a number of AJAX callbacks on this form that work well, but now I want to change some form elements depending on the age of the user, so when the date changes, other fields get replaced. Unfortunately, the "#ajax" element is not available on date fields (presumably because the field has three selects, rather than a single select).
Is there another way I can implement an AJAX callback?
I'm considering splitting the date field into 3 selects, which could each have an AJAX element, but that would lose all the benefits of the date field, so I don't want to unless I have to.
Thanks for your help,
James

Dynamic drop downs in Tridion designing in schema in SDL Tridion 2011 SP1

I am working on a Schema creation in SDL Tridion 2011 SP1.
I have struck at one thing.
I have to display three drop downs to user.
List: Country
List:State
List:Location
If the user selects one country in the drop down, need to populate the states according to it. Depending the selected state I have to populate Locations.
I thought of implementing through Categories.
Created categories to countries
Created States as Abstract Keywords under for each country.
Created locations as Normal keywords under every state as normal keywords.
Can any one suggest how to achieve the following:
I will have three drop downs, for Country, States, Locations.
If the User selects any Country, the states should be populated accordingly and depending on selected state the locations should be populated.
Do I need to do any customization to tridion or it can be implemented in Tridion directly?
Do you really need to select Countries and States? If you select a Location keyword from the taxonomy structure, you are indirectly selecting the Country and State. I would implement this as a single tree type keyword field.
E.g. Select "Dallas" and it will imply that you have selected "Texas" and "USA"
That way you only need one field. In the CME you will see be able to see items classified against USA by including child keywords, and on the Content Delivery side you will be able to query the content.
Do I need to do any customization to tridion...
Yes. If you want this exact behavior in the Component editing screen, you would need to implement it in a GUI extension.

Validation alert: An illegal choice has been detected in a CCK form

I am loading state select option through ajax for the selected country and by default the state option is
none
with the below reference stackoverflow issue asked few days b4,
how to set multi select CCK Field type for country state city with geoname module?
http://goo.gl/Xpwu0
I couldn't find any answer till now, so tried my own way by
if country selected, based on the country the state have to listed from geoname api so i did it through ajax and appended to the list correspondingly to city.
finally after submitting i got error
An illegal choice has been detected.
Please contact the site administrator.
The form system automatically validates the selected value of a select and only allows those which are defined in '#options'. There is no way around that in D6, in D7, there is a flag to disable that.
You need to use #ahah and rebuild the form on the serverside. The following modules might be useful to you:
http://drupal.org/project/ahah_helper (for building it yourself)
http://drupal.org/project/hierarchical_select (Maybe you can extend that...?)

Drupal Views and exposed filters - how to reset optional drop-down list filter, or allow "all" selection

I have a view with a filter by country. Country is an optional CCK text field with drop-down list selection from a predefined list.
When I expose the field as an optional view search filter, I can select a country on the filter form just fine, but how can I handle no selection? I want the user to be able to "un-select" any previously selected value so that the query runs for all countries (or, to be more precise, does not constrain the results by country). I cannot add "all" as a value to the CCK field for obvious reasons. Selecting all countries in the drop-down on the search filter is not very user-friendly and causes the page to time out (there are over 200 countries in the list, and I can only imagine the resulting SQL query). Whats the best way to handle this?
I found this View Filters Reset hack which could be helpful. The desire to memorize the last selection adds another complication - when configured in the View properties, and once the (persistent) cookie is set, there is no way to get rid of the selection (short of manually deleting the cookie).
The answer was to check "Force Single" on the filter properties. This made <any> show up as a selection in the country filter drop-down. It kind of makes sense, because <any> in a multiple-selection list could be seen as ambiguous. Still, I can think of valid reasons why a multiple selection filter might be optional. Drupal surprises me every day.

Resources