By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

Problem with some javascript and php

P: 13
I have a form with a <select> and i want to submit the form on the onchange event on this input.

Here is the code pls help.


<script language="text/javascript"> <!-- test javascript function abc(){ document.getElementById('akten').submit(); } //--> </script> </head>


<form action="" method="post" name="akten" id="akten">
<select name="nrAkt" size="1" onchange="abc()">


[PHP] <?php do { echo "<option value=\"".$row_Akt['ainr']."\">".$row_Akt['anr']."</option>"; } while($row_Akt = mysql_fetch_assoc($Akt)); ?> </select> <input type="hidden" name="message" value="data" /> <input type="submit" name="submit" value="submit" /> </form> [/PHP]

and i make the test of the form send with the value of the input message

[PHP] <?php echo $_POST['message']; if($_POST['message']=="data"){ ?>[/PHP]

Seems like the onchage event doesnt work and i didn t understand why.
Apr 23 '07 #1
Share this Question
Share on Google+
1 Reply

P: 13
pls delete this topic i've done it
Apr 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.