Hi

I am making a form that is dynamic. When a user selects a question another part is displayed. This all works fine without the first form tag in place. As soon as put the first form tag in place I get an error on javascript and it says it can't find a function. I have made the code below so you can see it. Please keep in mind its not finished and only one of the buttons leads to another part being displayed. In the current form the script will not work, however you will see I have marked the line to take out and then the script will work. Of course it is no good me leaving this line out as it needs to be there to make sure the form works. Any ideas where im going wrong.

<html>
<head>
<title></title>
<style type="text/css">
<!--
.blockDisplayOff {
display: none;
}
.blockDisplayOn {
display: block;
}
-->
</style>
<script language="JavaScript">
<!--
function show(DOM_Item)
{
if (document.getElementById) // netscape 6+ IE 5+ - make IE 4 compatible
{
thisItem = document.getElementById(DOM_Item).style;
thisItem.display = "block";
}
}
function hide(DOM_Item)
{
if (document.getElementById)
{
thisItem = document.getElementById(DOM_Item).style;
thisItem.display = "none";
}
}
function advertType(display) {
if (display) show('showAdvertSell');
else hide('showAdvertSell');
}
function freightType(display) {
if (display) show('showFOB');
else hide('showFOB');
}
function locationType(display) {
if (display) show('showCountrySelect');
else hide('showCountrySelect');
}
//-->
</script>
</head>
<body onLoad="advertType(1);freightType(0);">

<?php
echo '
//remove the line below this and it will work
<form action="'.$reg_page.'" name="formMemberRegistration" id="formMemberRegistration" method="post" onSubmit="return validateMemberRegistration()">
//remove the line above this and it will work

<table width="770" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td>Advert Name/td>
<td><input type</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">What type of advert do you want to place?</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="advertType" value="1" checked onClick="advertType(1);">Place an advert for *** for sale&nbsp;&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="advertType" value="0" onClick="advertType(0);">Place a wanted advert for ****.'.'</td>
</tr>
</table>
<span class="blockDisplayOff" id="showAdvertSell">
<br>
<table width="770" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2"><br>Please select where the goods are located. You can either have ex-works so that companies will collect the goods from your factory or select FOB so that you will deliver to a sea port at the border. If in doubt leave it set to ex-works.</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="freightType" value="0" checked onClick="freightType(0);">Ex-Works&nbsp;&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="freightType" value="1" onClick="freightType(1);">F.O.B.</td>
</tr>
</table>
</span>
<span class="blockDisplayOff" id="showFOB">
<br>
<table width="770" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2">Are the goods located in the country you are located in (the country you registered)</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="locationType" value="1" checked onClick="locationType(0);">Yes&nbsp;&nbsp;</td>
</tr>
<tr>
<td colspan="2"><input type="radio" name="locationType" value="0" onClick="locationType(1);">No</td>
</tr>
</table>
</span>
<span class="blockDisplayOff" id="showCountrySelect">
<br>
<table width="770" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2">Please select the country that the goods are located from the drop down list.</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">Country select goes here</td>
</tr>
</table>
</span>

<table width="770" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td colspan="2" align="right"><input type="submit" name="Submit" value="Next &gt;"></td>
</form>
';

?>


</body>
</html>