I generated a dropdown list using a program I found on a website..
It turned out ok,,, but I have no idea what to do with it.
Yes I am a 77 year old geek, and I want to know how to create some
activity when someone clicks on a choice.. I would like to be able
to identify the users location while he pages through my site..
So if someone selects USA and then KANSAS how am I supposed to know
and create some action.. Perhaps set a cookie on so I will not continue
to ask where he/she is located. Here is what I have now..
And keep in mind, I generated this code, I have no idea what it is doing, I know the dropdown list works...
Thanks, but I don't think you realize that there are some of us who really
are Dummies.. I know at least one of them,,,,, ME...
I have no idea what a PHP is, or if I even have PHP on my computer.
I Thank you since you are the only one who took time to answer.
As I said, I have no idea what PHP is, and in your response you said I
needed to add a "submit" button, not sure how or where this would go,
but I think you might be telling me that once the user selects a state,
I need to have another button asking him or her to submit..
As it stands you could copy and paste my code , then you will see
exactly what it does.
I am slightly familiar with cookie set/get since I learn by example and I have
seen some basic cookie code..
I would still welcome any advice other than suggesting I look up another
tutorial,, I have been through many, and each one only leaves me more
As you can see there is not much hope for me...
From your post i assume that you do not want to deal with server side programming but i will mention it briefly. If you submitted the user selection from the request you could get the value of his selection and use it on the backend. So, in a servlet or portlet for example your could do
String state =request.getParameter("idOfSelectBox");
<select id="state" name="state"><option value="alabama">Alabama
<option value="newyork">New York
you then need to notify your page that the value has changed so your selectbox tag now looks like this:
this puts an onclick event that triggers the function showState(). This function gets the value stored previously in the variable state and presents it in an alert.