Jump to content

Working with Refresh & Cookies!?


suess0r

Recommended Posts

Hi,

I have a city selector to find out what area you're in. 2 drop downs state -> then it populates corresponding cities. once they choose a city it sets the cookie to that city.

The problem i'm having is that it doesn't go into effect until after a refresh, I was wondering if A.) How i can add a refresh on my form (because I am POSTing to the same page, code below) or B.) How to get around the refresh in general...

Here's my code...

[quote]<form action="pg1.php" method="post" enctype="multipart/form-data" name="cf" id="form2">
          <div align="right">
                        <select id='countrySelect' name='country' onchange='populateState()'>
                        </select>
                        <select id='stateSelect' name='state' disabled=true onchange='printcity()' >
                        </select>
                        <script type="text/javascript" src="list.js"></script>
                        <script type="text/javascript">initCountry('CA'); </script>
          </div>
                    </form><div>
                      <div align="right">
                        <SCRIPT LANGUAGE="javascript">
document.write("Partying in: " +YouWrote+ ".");
    </SCRIPT>
<input name="Submit" type="submit" value="Go!" onclick="putCookie()"/>[/quote]

I know it's javascript but i'm not having issues with that, just the refresh problem.. any thoughts?
Link to comment
https://forums.phpfreaks.com/topic/35556-working-with-refresh-cookies/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.