I have a property site and I currently have it set up do that when entering a property the person selects a country.Depending on the country selected, the town drop down populates with certain towns in that country.ecause of the number of countries this javascript is pertty large and that worries me slightly. Also, if someone hasjavascript turned off then it doesn't work.In order to make it more accessible, would I have to seperate the form into 2 sepertate pages.
First off, I'm working with tumblr.com which allows Javascript, but not PHP embedded in the HTML pages. It strips them out. I want to be able to get the country code (us, ca, uk, etc.) when a visitor visits my webpage so I can provide links for their locale. I'm having a very hard time finding correct information with examples to get this working. There was some .js libraries out there, but they don't work properly and say I'm in CA when I'm in US, like the jsapi from Google. Is there a way to execute a .php script which would output the country code of the visitor and be able to read/capture this result within the Javascript?
I have a few javascripts. I would like to show a certain script based on the country ip of the viewer, how would I achieve this? is there html I could use to run the javascript based on the country ip?
How can make me selectting a country and then come out with a relative cities ?
for example if i select the American <select name="country"> <option value="american">american </option> <option value="australia">australia </option> </select>
I'm trying to build a pretty simple form that will redirect a user to a particular page based one the geographic location that they choose. I've actually found a pretty nifty script here [URL] but for the life of me, I can't get it to redirect a user when they hit a submit button. I can't get over the feeling that I'm missing something really simple.
Using JSON/JQuery/PHP I would like to be able to accomplish a dynamic dropdownlist. In my situation, I am trying to fetch countries from a mySQL database. Once user has selected a Country, if it is USA or Canada, I populate a Province DropDownList with the correct states / provinces.
I'm trying, so far unsuccessful to make a function to change the name of a hidden input based upon the country of the user, i have some php code that determines there country of origin of the user fine. I then have a small java script function to change the name of the hidden input depending on the country of origin.
The php variable that holds the country of origin is $country; that variable then needs to be assigned to x in my java script function. $country is equal to AU if your in Australia and US if your in America.[code]...
If you've seen from my previous posts in this forum, you may have noticed that i'm a newbie when it comes to javascript, anyway. I'm trying to create an array sort of thing to convert the country name's to continent, and set it as a cookie. I spent all that time writing a PHP script for this same thing only to find out that my webhost does not have the maxmind apache module. I also don't know how to get the value of the country from a javascript function.
PHP Code: function country_to_continent( $country ){$continent = '';if( $country== 'AF' ) $continent ='AS'; --CUT OFF DUE TO TEXT LIMIT, FIND THE FULL CODE HERE: http://infinitymedia.pastebin.com/7WWDeyVT return $continent;}
Initially the form is loaded using ASP and HTML and the ü codes display the characters correctly. I have the values stored in a javascript array so that I can more easily and dynamically change the state/region dropdown when the country changes. However, when my javascript code tries to add the new option and print out new region the literal value such as "Würrtemberg" is displayed instead of the special character.
I'm trying to find an example of a country selector (which also provides a state selector if USA is chosen) then you cvan select the city, any samples out there?
I currently have a Drop-Down menu, which has headers you click on to show the links. This menu only allows one drop to be expanded at a time, and can be viewed here [url].
I would like the headers to be able to have 'sub-headers' inside, which also drop-down,to reveal the links. I want them to have a different header colour, and to have the same rule where only one can be open at a time. while keeping the rule with the main headers.
Iam trying to Script a Double drop down list box in client side Javascript. I have 2 list box the 1st one has got category and the second one has subcategory. The second listbox should automatically fill in from the 1st one.
Am using Dreamweaver to select document.drop_list.SubCat but my Dreamweaver doesnt reorganize the ".drop_list". After i type document. it gives me a list of things but ".drop_list" is not included in that.
I know how to edit the CSS, and minute parts of the JavaScript code (for example; speed of the drop). The problem is, I had a massive amount of help making the Javascript side of the menu, and do not know how to edit it...
I want the rules to still apply, where only one can be expanded at a time (one of the first drops, and then only one of the sub-drops). I noticed in the code, I can edit it so there can be more than one drop, but that would mean, the whole menu could be expanded :(
Also, I want my sub-drops. to have different span colour than the main drop. but trhe links and such, (everything else about it) can be the same....
My live demo is here! (http://mrjamesmusic.com/tornhq/Index.html)
I thought I was so cool combining both this shopping cart with the double drop down menu, but now my menu isnt working and I can't seem to trouble shoot my way through it anymore. I am sure I am missing just one small part because the page loads fine, but when I select an option from step three where it says "select a subject" it no longer loads the options into the subsequent drop down menu which reads "Pages appear here" (at least I WISH they would appear there)
I am presently using a script provided by [url]. This script works great, however I need three sequential drop down menus rather than the two provided in this script. I need Country > Province/State > Cities. Unfortunately I am not a programmer, but generally muddle along to a resolution. In this case I am stumped. Can anyone show me what needs to be added to that existing script to convert it into a three menu script instead of two? I've searched extensively but find nothing about this. I apologize in advance for my lack of scripting knowledge, but much of JavaScript leaves me thoroughly confused. With html I am fine, but at 69 years of age the 'newer' scripts are leaving me behind.
In one of my webpage, I have a text field, upon double clicking on that text field, a look up table gets opened so that I can select a value on it.
There is no other way to open the lookup table other than double clicking on it.
How to double click on a text field using javascript. (In fact, how to double click on any HTML element). I cannot change the functionality of the web page to resolve this issue since the webpage was developed by me.
All I have to do is, I have to double click on the text field using javascript.
I know that using <a href="javascript:"> and <sometag onclick=""> is evil, but in this particular situation it is quite hard to avoid it due to external powers Anyway here is the issue itself : putting javascript strings inside HTML attributes :
Code:
<button onclick="DoSomething('string')">
Everything is fine until there are single or double quotes INSIDE the 'string' value. Having a double quote inside the string, even JS escaped leads to the onclick argument value being cut :
Code:
<button onclick="DoSomething('str"ing')">
If you replace the double quote by '"' then you don't get a double quote inside DoSomething (you could always replace " by " in JS).
Similar problem if you choose to enclose the onclick argument in single quotes and happen to have a single quote JS escaped inside the string.So, is there any other way of dealing with potential presence of single AND double quotes in the 'string' value, other than replacing them before by ' and " and then replacing them back inside DoSomething ?
How can I make it so i can drag and drop usernames from one selection box to another?Here's the code of two selection boxes one of which would be populated with usernames and another is empty where you move the username into to register him as banned.
I wanted to create a small DHTML code that created a unordered list of input forms dependent on the number selected from the select dropdown menu. Problem is that it doesn't seem to want to generate the list. I think the variables are within the scope of the function too, and I didn't get an errors from the javascript console when using firebug. The script itself runs, I tested it when I used the old standby alert(); to see if the script was active. Here's the code: