You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Getting quite a few emails now with overseas customers having problems during checkout. The resounding complaint is that they keep getting the "incomplete form" issue. I believe it's the fact that they aren't selecting "Non-Applicable" from the state dropdown menu.
Is there a way I can set that field to "autoselect" Nonapplicable? That way it will always have SOMETHING selected, and US customers (who have to change it anyway) can just drop it down to their state.
If not, where would I add the text to point out that users need to select "Non Applicable" if they are not in the US. With the "intelligence" built into this app, I'd like to think there's a way to autoselect that field.
Help would be greatly appreciated.
Thanks.
Offline
Steve (that's you, right?)
Here's what Nick did for us:
I edited the XHTML include 'Formfield: Selection List' to achieve this
and added:
if ((empty($defaultvalue)) && (preg_match('/stateprov$/',$id))) { $defaultvalue = 'Not Applicable'; }
it appears to be working.
Offline
Hey if anyone wants to do this in CCP7 it still works. Here's the full code from "Formfield: Selection List"
<?php
$id = $this->xhtml_encode($this->globals('core_form.field.id'));
$name = $this->xhtml_encode($this->globals('core_form.field.name'));
$description = $this->globals('core_form.field.description');
$required = $this->globals('core_form.field.required');
$defaultvalue = $this->xhtml_encode($this->globals('core_form.field.defaultvalue'));
$cssstyle = 'formfield';
$values = $this->globals('core_form.field.values');
if ((empty($defaultvalue)) && (preg_match('/stateprov$/',$id))) {
$defaultvalue = 'Not Applicable';
}
$legstyle = 'formfieldleg';
if (($this->globals('core_form.reqnotcomp')) && ($required)) {
if ((empty($defaultvalue)) && (!($defaultvalue === '0'))) {
$legstyle .= '_rnc';
}
}
?>
<fieldset>
<legend class="strong"><label for="<?php print $id; ?>"><?php print $name; if ($required) {print '*';} ?></label></legend>
<p class="<?php print $legstyle; ?>"><?php print $name; if ($required) {print '*';} ?></p>
<?php if ($description) {print $description;} ?>
<select class="<?php print $cssstyle; ?>" name="<?php print $id; ?>" id="<?php print $id; ?>">
<option value=""></option>
<?php
foreach ($values as $name => $value) {
$name = $this->xhtml_encode($name);
$value = $this->xhtml_encode($value);
if ($defaultvalue == $name) {$selected = ' selected="selected"';}
else {$selected = '';}
$field = '<option value="' . $name . '"' . $selected;
$field .= '>' . $value . '</option>' . $this->globals('core.eol');
print $field;
} // End of foreach statement.
?>
</select>
</fieldset>
Offline
Something like this might also help:
https://forum.kryptronic.com/viewtopic.php?id=23322
Offline