Jump to content

using php to grab variables from memory that javascript has put in memory


todayme

Recommended Posts

I have three text boxes, first one is the dropdownindusty.php below, the next one is the static html you see down further, when the second text box changes the java scipt grabs both values and stores them in a variable.

 

At the end of that java script I am going to ask it to call another function, which will be a php script which will grab the two variables and do what it needs before populating the third text box.

 

My question is, how do with PHP grab the values of those two variables?  Can this be done?

 

<?php

      include("dropdownindustry.php");

      ?>

     

     

     

     

     

</td>

                  </tr>

                  <tr>

                    <td width="27%" height="22"><b>State:</b></td>

                    <td width="82%" height="22"><select size="1" name="State" onchange="captureselection()">

                    <option value="Brisbane">Brisbane</option>

                    <option value="Queensland">Queensland</option>

                    <option value="New_South_Whales">New South Whales</option>

                    <option value="Victoria">Victoria</option>

                    <option value="South_Australia">South Australia</option>

                    <option value="Western_Australia">Western Australia</option>

                    </select></tr>

                   

                   

                 

<SCRIPT LANGUAGE="javascript">

 

function captureselection()

 

{

 

var locatestate = window.location

var locateindustry = window.location

 

document.Leads.State.value = locatestate

document.Leads.Industry.value = locateindustry

 

var cool_state = document.Leads.State.value

var cool_industry = document.Leads.Industry.value

 

document.write(cool_state);

document.write(cool_industry);

 

}

                    </SCRIPT> 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.