- Posts: 112
- Thank you received: 0
States dropdown box are not shown
I came across an weird behavior of hikashop registration form. I use the same form on two pages: Checkout and Registration Form.
On the Checkout page the States are not showing up, but on the Registration Form page they are. Please see a screenshot for details.
Any idea as to why this can be happening?
Thank you in advance.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
I'm guessing it must be related to a javascript error...
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
There is a good chance that there is a javascript error stopping the javascript process of the page and thus the state dropdown display. If you can copy/paste it here...
Also, if you can copy/paste the headers of the page, that would help as well.
Please Log in or Create an account to join the conversation.
Here are the headers:
Page where states work:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" www.w3.org/1999/xhtml " xml:lang="en-gb" lang="en-gb">
<head>
<script type="text/javascript">
var siteurl='/j16events2/';
var tmplurl='/j16events2/templates/ja_events/';
var isRTL = false;
</script>
<base href="http://localhost/j16events2/index.php/sign-up" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="" />
<meta name="rights" content="" />
<meta name="language" content="en-GB" />
<meta name="generator" content="Joomla! 1.6 - Open Source Content Management" />
<title>Sign Up or Sign In</title>
<link rel="stylesheet" href="/j16events2/t3-assets/css06fdc.css?v=47" type="text/css" />
<script type="text/javascript" src="/j16events2/t3-assets/js11fbe.js"></script>
<script type="text/javascript">
<!--
var hikashop=Array();
hikashop=Array();
hikashop=Array();
//-->
<!--
hikashop = Array('name','username','email','password','password2');
hikashop = Array('Please enter a value for the field name','Please enter a value for the field username','Please enter a value for the field email','Please enter a value for the field password','Please enter a value for the field password2');
hikashop = 'Passwords do not match';
hikashop = 'Please enter a valid e-mail address';
hikashop = Array('address_firstname','address_lastname','address_street','address_city','address_post_code','address_telephone','gender','yearofbirth');
hikashop = Array('Please enter a value for the field First name','Please enter a value for the field Last name','Please enter a value for the field Street','Please enter a value for the field City','Please enter a value for the field Post code','Please enter a value for the field Telephone','Please enter a value for the field Gender','Please enter a value for the field Year of Birth');
hikashop = 'Please enter a valid phone number';
//-->
<!--
function optionValueIndexOf(options,value) {
for (var i=0;i<options.length;i++) {
if (options.value == value) {
return i;
}
}
return -1;
}
function changeState(newvalue){
var defaultValInput = document.getElementById('state_default_value');
var defaultVal = '';
var namekey = false;
if(defaultValInput){
defaultVal = defaultValInput.value;
namekey = document.getElementById('state_namekey').value;
}
if(namekey){
try{
new Ajax('/j16events2/index.php/sign-up/checkout/state/tmpl-component?field_type=address&field_namekey=address_state&namekey='+newvalue, { method: 'get', onComplete: function(result) { old = window.document.getElementById('state_dropdown'); if(old){ old.innerHTML = result;if(namekey) {var stateSelect = document.getElementById(namekey); if(stateSelect && optionValueIndexOf(stateSelect.options, defaultVal) >= 0) stateSelect.value=defaultVal;}}}}).request();
}catch(err){
new Request({url:'/j16events2/index.php/sign-up/checkout/state/tmpl-component?field_type=address&field_namekey=address_state&namekey='+newvalue, method: 'get', onComplete: function(result) { old = window.document.getElementById('state_dropdown'); if(old){ old.innerHTML = result;if(namekey) {var stateSelect = document.getElementById(namekey); if(stateSelect && optionValueIndexOf(stateSelect.options, defaultVal) >= 0) stateSelect.value=defaultVal;}}}}).send();
}
}
}
window.addEvent('domready', function(){ changeState(document.getElementById('address_country').value); });
//-->
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
</script>
<link href="/j16events2/plugins/system/jat3/jat3/base-themes/default/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<!--[if IE 7.0]>
<style>
.clearfix { display: inline-block; } /* IE7xhtml*/
</style>
<![endif]-->
<style type="text/css">
#ja-mainnav .main-inner2 {width: 74%;}
</style>
<!-- width for left, right banner -->
<script type="text/javascript">
window.addEvent ('load', function () {
var w = $('ja-wrapper').offsetWidth;
if ($('ja-container') && $('ja-container').getElement('.main')) w -= $('ja-container').getElement('.main').offsetWidth;
w /= 2;
if ($('ja-left-banner')) $('ja-left-banner').setStyle ('width', w);
if ($('ja-right-banner')) $('ja-right-banner').setStyle ('width', w);
//height for top-banner
if ($('ja-header') && $('ja-top-banner')) $('ja-top-banner').setStyle ('height', $('ja-header').offsetHeight);
});
</script>
<style type="text/css">
/*dynamic css*/
body.bd .main {width: 960px;}
body.bd #ja-wrapper {min-width: 960px;}
</style></head>
Page where states don't work:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" www.w3.org/1999/xhtml " xml:lang="en-gb" lang="en-gb">
<head>
<script type="text/javascript">
var siteurl='/j16events2/';
var tmplurl='/j16events2/templates/ja_events/';
var isRTL = false;
</script>
<base href="http://localhost/j16events2/index.php/hikashop" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="" />
<meta name="rights" content="" />
<meta name="language" content="en-GB" />
<meta name="generator" content="Joomla! 1.6 - Open Source Content Management" />
<title>Hikashop</title>
<link rel="stylesheet" href="/j16events2/t3-assets/css06fdc.css?v=47" type="text/css" />
<style type="text/css">
#hikashop_category_information_menu_602 div.hikashop_subcontainer {
background:#FFFFFF;
}
#hikashop_category_information_menu_602 .hikashop_rtop *,#hikashop_category_information_menu_602 .hikashop_rbottom *{
background:#FFFFFF;
}
#hikashop_category_information_menu_602 div.hikashop_subcontainer {
text-align:center;
}
#hikashop_category_information_menu_602 div.hikashop_container {
text-align:center;
}
#hikashop_category_information_menu_602 div.hikashop_container {
margin:10px 10px;
}
#hikashop_category_information_menu_602 div.hikashop_category,#hikashop_category_information_menu_602 div.hikashop_product{
float:left;
width:100%;
}
#hikashop_category_information_menu_602 .hikashop_subcontainer {
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-khtml-border-radius: 5px;
border-radius: 5px;
}
</style>
<script type="text/javascript" src="/j16events2/t3-assets/js11fbe.js"></script>
<script type="text/javascript">
<!--
function hikashopModifyQuantity(id,obj,add,form){
if(add){
add='&add=1';
}else{
add='';
}
if(obj){
qty=parseInt(obj.value);
}else{
qty=1;
}
if(form){
var varform = eval('document.'+form);
if(varform){
varform.submit();
}
}else{
try{
new Ajax('/j16events2/index.php/hikashop/product/updatecart/tmpl-component?product_id='+id+'&quantity='+qty+add+'&Itemid=602&return_url=aHR0cDovL2xvY2FsaG9zdC9qMTZldmVudHMyL2luZGV4LnBocC9oaWthc2hvcA%3D%3D', { method: 'get', onComplete: function(result) { var hikaModule = window.document.getElementById('hikashop_cart_module'); if(hikaModule) hikaModule.innerHTML = result;window.location = 'http://localhost/j16events2/index.php/hikashop';}}).request();
}catch(err){
new Request({url:'/j16events2/index.php/hikashop/product/updatecart/tmpl-component?product_id='+id+'&quantity='+qty+add+'&Itemid=602&return_url=aHR0cDovL2xvY2FsaG9zdC9qMTZldmVudHMyL2luZGV4LnBocC9oaWthc2hvcA%3D%3D', method: 'get', onComplete: function(result) { var hikaModule = window.document.getElementById('hikashop_cart_module'); if(hikaModule) hikaModule.innerHTML = result;window.location = 'http://localhost/j16events2/index.php/hikashop';}}).send();
}
}
return false;
}
//-->
<!--
function hikashopCheckCoupon(id){
var el = document.getElementById(id);
if(el){
if(el.value==''){
el.className = 'hikashop_red_border';
return false;
}
el.form.submit();
}
return false;
}
//-->
<!--
var hikashop=Array();
hikashop=Array();
hikashop=Array();
//-->
<!--
hikashop = Array('name','username','email','password','password2');
hikashop = Array('Please enter a value for the field name','Please enter a value for the field username','Please enter a value for the field email','Please enter a value for the field password','Please enter a value for the field password2');
hikashop = 'Passwords do not match';
hikashop = 'Please enter a valid e-mail address';
hikashop = Array('address_firstname','address_lastname','address_street','address_city','address_post_code','address_telephone','gender','yearofbirth');
hikashop = Array('Please enter a value for the field First name','Please enter a value for the field Last name','Please enter a value for the field Street','Please enter a value for the field City','Please enter a value for the field Post code','Please enter a value for the field Telephone','Please enter a value for the field Gender','Please enter a value for the field Year of Birth');
hikashop = 'Please enter a valid phone number';
//-->
<!--
function moveOnMax(field,nextFieldID){
if(field.value.length >= field.maxLength){
document.getElementById(nextFieldID).focus();
}
}
window.addEvent('domready', function(){var mySlide_paypal_2 = new Fx.Slide('hikashop_credit_card_paypal_2');
var hikashop_last_opened_slide = mySlide_paypal_2;
$('radio_paypal_2').addEvent('click', function(e){
hikashop_last_opened_slide.toggle();
mySlide_paypal_2.toggle();
hikashop_last_opened_slide = mySlide_paypal_2;
}); });
var ccHikaErrors = new Array ()
ccHikaErrors [3] = 'Credit card number is invalid';
ccHikaErrors [5] = 'Credit card expired';
//-->
window.addEvent('domready', function() {
$$('.hasTip').each(function(el) {
var title = el.get('title');
if (title) {
var parts = title.split('::', 2);
el.store('tip:title', parts[0]);
el.store('tip:text', parts[1]);
}
});
var JTooltips = new Tips($$('.hasTip'), { maxTitleChars: 50, fixed: false});
});
<!--
hikashop = Array('name','username','email','password','password2');
hikashop = Array('Please enter a value for the field name','Please enter a value for the field username','Please enter a value for the field email','Please enter a value for the field password','Please enter a value for the field password2');
hikashop = 'Passwords do not match';
hikashop = 'Please enter a valid e-mail address';
hikashop = 'Please enter a valid phone number';
//-->
<!--
function optionValueIndexOf(options,value) {
for (var i=0;i<options.length;i++) {
if (options.value == value) {
return i;
}
}
return -1;
}
function changeState(newvalue){
var defaultValInput = document.getElementById('state_default_value');
var defaultVal = '';
var namekey = false;
if(defaultValInput){
defaultVal = defaultValInput.value;
namekey = document.getElementById('state_namekey').value;
}
if(namekey){
try{
new Ajax('/j16events2/index.php/hikashop/checkout/state/tmpl-component?field_type=address&field_namekey=address_state&namekey='+newvalue, { method: 'get', onComplete: function(result) { old = window.document.getElementById('state_dropdown'); if(old){ old.innerHTML = result;if(namekey) {var stateSelect = document.getElementById(namekey); if(stateSelect && optionValueIndexOf(stateSelect.options, defaultVal) >= 0) stateSelect.value=defaultVal;}}}}).request();
}catch(err){
new Request({url:'/j16events2/index.php/hikashop/checkout/state/tmpl-component?field_type=address&field_namekey=address_state&namekey='+newvalue, method: 'get', onComplete: function(result) { old = window.document.getElementById('state_dropdown'); if(old){ old.innerHTML = result;if(namekey) {var stateSelect = document.getElementById(namekey); if(stateSelect && optionValueIndexOf(stateSelect.options, defaultVal) >= 0) stateSelect.value=defaultVal;}}}}).send();
}
}
}
window.addEvent('domready', function(){ changeState(document.getElementById('address_country').value); });
//-->
</script>
<link href="/j16events2/plugins/system/jat3/jat3/base-themes/default/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<!--[if IE 7.0]>
<style>
.clearfix { display: inline-block; } /* IE7xhtml*/
</style>
<![endif]-->
<style type="text/css">
#ja-mainnav .main-inner2 {width: 74%;}
</style>
<!-- width for left, right banner -->
<script type="text/javascript">
window.addEvent ('load', function () {
var w = $('ja-wrapper').offsetWidth;
if ($('ja-container') && $('ja-container').getElement('.main')) w -= $('ja-container').getElement('.main').offsetWidth;
w /= 2;
if ($('ja-left-banner')) $('ja-left-banner').setStyle ('width', w);
if ($('ja-right-banner')) $('ja-right-banner').setStyle ('width', w);
//height for top-banner
if ($('ja-header') && $('ja-top-banner')) $('ja-top-banner').setStyle ('height', $('ja-header').offsetHeight);
});
</script>
<style type="text/css">
/*dynamic css*/
body.bd .main {width: 960px;}
body.bd #ja-wrapper {min-width: 960px;}
</style></head>
Please Log in or Create an account to join the conversation.
Please try to deactivate the joomla cache (in the configuration and in the cache plugin) and try again.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please remember the States box works on one page and doesn't work on another.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Is there a way to modify the code so that the states box is populated statically, I mean not using javascript?
Please Log in or Create an account to join the conversation.
echo $this->fieldsClass->display($oneExtraField,$this->$type->$fieldName,'data');
by:
echo $this->fieldsClass->display($oneExtraField,$this->$type->$fieldName,'data',false,'',true);
in the file custom_fields of the view user via the menu Display->Views.
That should deactivate the state field javascript and display it statically.
Please Log in or Create an account to join the conversation.
I've tried changing it as per your suggestion. Now, I can see the drop down box, but it's empty, on both pages.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.