Who can help me with the folowing
I have javascrip variable and a php datatable
And i wand to read the datatable with the javascript variable
here is the code i have

if(!isset($_POST['bewerk_gegevens']))
{
    ?>
    <script language="javascript" type="text/javascript">
        var newland = document.getElementById("geboorte_land").value;
        if ((newland != "" && newland != "Duitsland") || (newland != "" && newland != "USA"))
        {
            var x=document.getElementById("provincie")
            x.options[x.selectedIndex].text="Kies een provincie:"
        }
    </script>

    <?php
    $resulta = mysql_query("SELECT * FROM stamboom_provincies_var newland ");
    while($rowa = mysql_fetch_array($resulta))
    {
        echo "<option value='".$rowa['provincie']."'>".$rowa['provincie']."</option>";
    }
}

how can i use the datatable with var newland in stamboom_provincies_var newland?

Thanks in advice John

Recommended Answers

All 2 Replies

Member Avatar for diafol

You can't do that with js. You'll need to use Ajax.

Oke thanks i tought it I will make an other solution i have it almost With post from an other page.

thank for the reply

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.