can any one help to me to get variable from jquery and use in php



I understand the question and the answer is going to be complex. First you need to add onChange event to your ProducerType selectbox. Add this at the end of your html:

   // attach event on change
      // call script on server to check if isset() and receive values for Role
               // here the script on server returned data already
               // update Role selectbox with new values

Make sure you have jquery.js loaded as usual.

You will need to create a PHP script on server which handles the check and returns new data for your select input. Like this (save as "checkproducer.php"):

    if ($_GET['ProducerType']=="Principal")
       echo "<option value=1>Principal1</option>"
           ."<option value=2>Principal2</option>";
    if ($_GET['ProducerType']=="Producer")
       echo "<option value=1>Producer1</option>".
           ."<option value=2>Producer2</option>";
    if ($_GET['ProducerType']=="SoleProprietor")
       echo "<option value=1>SoleProprietor1</option>"
           ."<option value=2>SoleProprietor2</option>";

    // etc

People are also looking for solutions to the problem: PHP MySQL if row exists not doing anything


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.