This is my code

<DIV id='list'>
	<FORM METHOD=POST name="sizeform" >
		<SELECT NAME="size" multiple onClick='choice()' >

		<OPTION value="big">big</OPTION>
		<OPTION value="small">small</OPTION>

		<OPTION value="large">Large</OPTION>
	</SELECT>
</FORM>
</DIV>
<DIV id='list'>
	<FORM METHOD=POST ACTION="<?php echo $_SERVER['REQUEST_URI'];  ?>" name="newpackage">
	<SELECT NAME='item[]' multiple id='itemselect'>

</SELECT>
<INPUT TYPE="submit">
</FORM>
</DIV>
<script language="Javascript">
function choice() {
var selectname=sizeform.size.value;
document.getElementById('itemselect').innerHTML += "<OPTION VALUE='"+selectname+"'>"+selectname+"</OPTION>";
}
</script>
<?php

print_r($_POST);

?>

How can I post the variables constructed by the js?
If I was unable to explain myself here you may copy and paste this code and you'll see what I'm referring too.

    Well, you don't have the handler set in your form tag:

    <form method="post" action="handlerpage.php" onSubmit="myJavascript">

    ... does that help?

      I gives me an idea of my error, but I wouldn't know what to code for the OnSubmit event handler.

        Well, you don't necessarily need an onSubmit handler, unless you want some Javascript to be executed when the submit button is pushed on that form.... I guess I put it there because you had some sort of event trigger up there ... but, looking at it, it wasn't on the submit, was it? 😉

        Sorry if that confused ya.

          I appreciate your efforts in taking a look and helping me with the code.

          I just don't know why I can't post the form? It must be something really simple but I can't figure it out.

            I got it to work. The code is fine, the only problem was that I wasn't selecting the options.

            Thank you everyone who took their time in looking for a solution.

              Write a Reply...