Jump to content

Disabling Country Dropdown


Webmaster001

Recommended Posts

Hi,

 

In the ajax orderform how can we disable the dropdown and assign a "demo" value. We did the following

 

<!--{if $loggedin}{$clientsdetails.country}{else}<input type="hidden" name="country" style="width:40%;" value="demo" />{/if} -->

 

<!--<tr class="rowcolor1"><td class="fieldlabel">{$LANG.clientareacountry}</td><td class="fieldarea"><input type="text" name="domaincontactcountry" size="15" value="{$domaincontact.country}" /></td></tr>

 

 

And we have commented (disabled) the dropdown lines however we are still seeing the following error:

 

"Please choose your country from the drop down box"

Link to comment
Share on other sites

I don't know if this will help, but the list of countries in the drop down list can be edited in

 

includes -> countries.php

 

so you could remove them all and add "demo" if that is what you want...

 

btw - do you realise that you've commented out the hidden field in the first line, and not ended the comment in the second ?

also, $domaincontact.country doesn't exist in the current ajax form.

 

i'm not sure what you're trying to achieve with this, but wouldn't it be easier to add a custom field rather than mess around with the country dropdown ?

Link to comment
Share on other sites

I don't know if this will help, but the list of countries in the drop down list can be edited in

 

includes -> countries.php

 

so you could remove them all and add "demo" if that is what you want...

 

btw - do you realise that you've commented out the hidden field in the first line, and not ended the comment in the second ?

also, $domaincontact.country doesn't exist in the current ajax form.

 

i'm not sure what you're trying to achieve with this, but wouldn't it be easier to add a custom field rather than mess around with the country dropdown ?

 

 

Thanks for your help. For our product we do not care for clients address so we just want to assign a demo value to it and hide it from the checkout form so the client even doesn't have to fill that. However regardless of what we do we keep seeing the same error of

 

Please choose your country from the drop down box

 

I have removed the commented line and however we keep receiving the error . Any suggestion?

 

Thanks

Link to comment
Share on other sites

I have removed the commented line and however we keep receiving the error . Any suggestion?

well you could hide the dropdown by using the following...

 

<tr class="rowcolor1 signupfields" style="display:none;"><td class="fieldlabel">{$LANG.clientareacountry}</td><td class="fieldarea">{if $loggedin}{$clientsdetails.country}{else}{$clientcountrydropdown}{/if}</td></tr>

that should allow the form to work without throwing up the error message you previously saw.

 

if you still need to pass the value "demo" (or similar) in a field, you're probably better off using a custom field (and perhaps hiding it).

Link to comment
Share on other sites

well you could hide the dropdown by using the following...

 

 

that should allow the form to work without throwing up the error message you previously saw.

 

if you still need to pass the value "demo" (or similar) in a field, you're probably better off using a custom field (and perhaps hiding it).

 

Ok, so finally I have resolved it. The problem was the "Template Cache". I deleted all files in the /whmcs/template_c

 

It seems the code was not getting updated so the original solution was fine and we finally could assign a demo value to the country.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated