hello...

i am doing shopping cart. in that there is billing address is there and shipping address is there. in there between "copy" link is there. when that page is loading "billing address fields comming and 'copy' link is also comming. but shipping address fields are not comming. after 'copy' link bellow error occuring. billing address , copy link, shipping address fields are in one form. plz solve my prblm.

"HTTP/1.1 200 OK Date: Wed, 04 Nov 2009 05:13:59 GMT Server: Apache/2.0.55 (Win32) PHP/5.1.4 X-Powered-By: PHP/5.1.4 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Keep-Alive: timeout=15, max=97 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html 1200d "

hello...

i am doing shopping cart. in that there is billing address is there and shipping address is there. in there between "copy" link is there. when that page is loading "billing address fields comming and 'copy' link is also comming. but shipping address fields are not comming. after 'copy' link bellow error occuring. billing address , copy link, shipping address fields are in one form. plz solve my prblm.

"HTTP/1.1 200 OK Date: Wed, 04 Nov 2009 05:13:59 GMT Server: Apache/2.0.55 (Win32) PHP/5.1.4 X-Powered-By: PHP/5.1.4 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Keep-Alive: timeout=15, max=97 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html 1200d "

I suspect these are the html headers echoed by your browser and the succeeding exit.
Post your this part of the code.

hello...
'copy' link is also comming. but shipping address fields are not comming. after 'copy' link bellow error occuring."

code for copy link?

code for copy link?

<script language="javascript">
function copy()
{
	window.document.formx.name1.value=window.document.formx.name.value;
	window.document.formx.lastname1.value=window.document.formx.lastname.value;
	window.document.formx.address21.value=window.document.formx.address1.value;
	window.document.formx.bemail.value=window.document.formx.semail.value;	
	
	if(window.document.formx.state1.value!='')
	{
	window.document.formx.state3.value=window.document.formx.state1.value;
	}
	else
	{
	window.document.formx.state3.value=window.document.formx.state.value;
	}
	window.document.formx.zip1.value=window.document.formx.zip.value;
	window.document.formx.country1.value=window.document.formx.country.value;
	window.document.formx.phone1.value=window.document.formx.phone.value;
}
</script>

i wrote in java script . copy button calling this function.

Do not find anything wrong with this function,until you have all the element s always in the html when you call this function. but where does it gets called.

Do not find anything wrong with this function,until you have all the element s always in the html when you call this function. but where does it gets called.

k. see this . this is totally in one form.

<table >
                                        
                                        <tr>
                                         <td height="20" align="left"  colspan="2"valign="middle" bgcolor="#C2E1FE" class="normal_text_bold2">Shipping Information</span> </td>
                                        </tr>
                                       
                                        <tr>
                                          <td width="229"height="25" align="right" valign="middle" class="inner_product_text">First Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="name" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[firstname]?>" tabindex="1" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Last Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="lastname" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[lastname]?>" tabindex="2" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text"> Address  : </td>
                                          <td height="25" align="left" valign="middle"><input name="address1" type="text" class="form_1"  size="30" tabindex="3" value="<?=$sqlfetcharray2[address]?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Email Id : </td>
                                          <td height="25" align="left" valign="middle"><input name="semail" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2['emailid']?>" tabindex="4" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Country :</td>
                                          <td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
										  
<tr>
<td width="50%" height="25" align="left" valign="middle"><select name="country"   onchange="changeState()">
<option value="" selected="selected">--select--</option>
<?php
if($sqlfetcharray2['country'])
{
?>
<option value="<?=$sqlfetcharray2['country']?>" selected="selected">
<?=$sqlfetcharray2['country']?>
</option>
<?	} 

foreach($totalcountry as $val){ if($val!=$sqlfetcharray2['country']) { ?>
<option value="<?=$val?>">
<?=$val?>
</option>
<?php } }?>
</select></td>
</tr>

                                            </table></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">State :</td>
                                          <td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td align="left" id="display" style="display:none;"><select name="state" id="state"  class="select"  >
                                                    <option value="" selected="selected">--select--</option>
                                                  </select></td>
                                                <td align="left" id="display1" style="display"><input type="text" name="state1"  size="30"  value="<?=$sqlfetcharray2['state']?>" />                                                </td>
                                              </tr>
                                            </table></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Zip Code :</td>
                                          <td height="25" align="left" valign="middle"><input name="zip" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['zipcode']?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Phone :</td>
                                          <td height="25" align="left" valign="middle"><input name="phone" type="text" class="form_1"  size="30"  maxlength="20" value="<?=$sqlfetcharray2['phoneno']?>" /></td>
                                        </tr>
                                       
                                      </table></td>
        </tr>
		 <tr>
                                    <td colspan="3" align="center"  class="colorred10" valign="middle"><a href="javascript:copy();" tabindex="9"><img src="images/copy.png" border="0"  /></a> </td>
                                  </tr>
                                  <tr>
                                    <td>&nbsp;</td>
									</tr>
      						  
		<tr>
		<td height="274">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="borders">
                                        <tr>
                                          <td width="229" height="1" align="left" valign="top" bgcolor="#1A76B9"></td>
                                          <td width="556" height="1" align="left" valign="middle" bgcolor="#1A76B9"></td>
                                        </tr>
                                        <tr>
                                         <td height="17" colspan="2" align="left" valign="middle" bgcolor="#C2E1FE" class="normal_text_bold2">Billing Information </td>
                                        </tr>
                                        <tr>
                                          <td height="3" align="left" valign="top" class="blue_top_borders">&nbsp;</td>
                                          <td height="3" align="left" valign="middle" class="blue_top_borders">&nbsp;</td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Fist Name :</td>
                                          <td height="25" align="left" valign="middle"><input name="name1" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[firstname]?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Last Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="lastname1" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2[lastname]?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Address  :</td>
                                          <td height="25" align="left" valign="middle"><input name="address21" type="text" class="form_1"  size="30"   value="<?=$sqlfetcharray2[address]?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Email Id : </td>
                                          <td height="25" align="left" valign="middle"><input name="bemail" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['emailid']?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Country : </td>
                                          <td height="25" align="left" valign="middle"><select name="country1"   onchange="changeState1();">
                                              <option value="" selected="selected">--select--</option>
                                              <?php
	if($sqlfetcharray2['country'])
	{
	?>
      <option value="<?=$sqlfetcharray2['country']?>" selected="selected">
   <?=$sqlfetcharray2['country']?>
      </option>
      <?	} ?>
	
	<?php /*?>foreach($totalcountry as $val){ if($val!=$sqlfetcharray2['country']) {?>
      <option value="<?=$val?>">
    <?=$val?>
    </option>
    <?php } }?><?php */?>

     </select>                                          </td>
                                          </tr>
<tr>
<td width="229" height="25" align="right" valign="middle" class="inner_product_text">State : </td>
<td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" id="display" style="display:none;"><select name="state2" id="state2"  class="select" >
<option value="" selected="selected">--select--</option>
</select>                                                </td>
<td align="left" id="display2" style="display"><input type="text" name="state3"  value="<?=$sqlfetcharray2['state']?>" size="30"  /></td>
</tr>
</table></td>
</tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text"> ZipCode : </td>
                                          <td height="25" align="left" valign="middle"><input name="zip1" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['zipcode']?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="22" align="right" valign="middle" class="inner_product_text">Phone :</td>
                                          <td height="22" align="left" valign="middle"><input name="phone1" type="text" class="form_1"  size="30" maxlength="20"  value="<?=$sqlfetcharray2['phoneno']?>" /></td>
                                        </tr>
                  </table>

what you doing after this code, there is no form in your html and no submit or any other button too.

what you doing after this code, there is no form in your html and no submit or any other button too.

actually this total code is in one form. in that form last submit button is there.

k. see this . this is totally in one form.

<table >
                                        
                                        <tr>
                                         <td height="20" align="left"  colspan="2"valign="middle" bgcolor="#C2E1FE" class="normal_text_bold2">Shipping Information</span> </td>
                                        </tr>
                                       
                                        <tr>
                                          <td width="229"height="25" align="right" valign="middle" class="inner_product_text">First Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="name" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[firstname]?>" tabindex="1" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Last Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="lastname" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[lastname]?>" tabindex="2" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text"> Address  : </td>
                                          <td height="25" align="left" valign="middle"><input name="address1" type="text" class="form_1"  size="30" tabindex="3" value="<?=$sqlfetcharray2[address]?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Email Id : </td>
                                          <td height="25" align="left" valign="middle"><input name="semail" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2['emailid']?>" tabindex="4" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Country :</td>
                                          <td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
										  
<tr>
<td width="50%" height="25" align="left" valign="middle"><select name="country"   onchange="changeState()">
<option value="" selected="selected">--select--</option>
<?php
if($sqlfetcharray2['country'])
{
?>
<option value="<?=$sqlfetcharray2['country']?>" selected="selected">
<?=$sqlfetcharray2['country']?>
</option>
<?	} 

foreach($totalcountry as $val){ if($val!=$sqlfetcharray2['country']) { ?>
<option value="<?=$val?>">
<?=$val?>
</option>
<?php } }?>
</select></td>
</tr>

                                            </table></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">State :</td>
                                          <td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
                                              <tr>
                                                <td align="left" id="display" style="display:none;"><select name="state" id="state"  class="select"  >
                                                    <option value="" selected="selected">--select--</option>
                                                  </select></td>
                                                <td align="left" id="display1" style="display"><input type="text" name="state1"  size="30"  value="<?=$sqlfetcharray2['state']?>" />                                                </td>
                                              </tr>
                                            </table></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Zip Code :</td>
                                          <td height="25" align="left" valign="middle"><input name="zip" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['zipcode']?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Phone :</td>
                                          <td height="25" align="left" valign="middle"><input name="phone" type="text" class="form_1"  size="30"  maxlength="20" value="<?=$sqlfetcharray2['phoneno']?>" /></td>
                                        </tr>
                                       
                                      </table></td>
        </tr>
		 <tr>
                                    <td colspan="3" align="center"  class="colorred10" valign="middle"><a href="javascript:copy();" tabindex="9"><img src="images/copy.png" border="0"  /></a> </td>
                                  </tr>
                                  <tr>
                                    <td>&nbsp;</td>
									</tr>
      						  
		<tr>
		<td height="274">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="borders">
                                        <tr>
                                          <td width="229" height="1" align="left" valign="top" bgcolor="#1A76B9"></td>
                                          <td width="556" height="1" align="left" valign="middle" bgcolor="#1A76B9"></td>
                                        </tr>
                                        <tr>
                                         <td height="17" colspan="2" align="left" valign="middle" bgcolor="#C2E1FE" class="normal_text_bold2">Billing Information </td>
                                        </tr>
                                        <tr>
                                          <td height="3" align="left" valign="top" class="blue_top_borders">&nbsp;</td>
                                          <td height="3" align="left" valign="middle" class="blue_top_borders">&nbsp;</td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Fist Name :</td>
                                          <td height="25" align="left" valign="middle"><input name="name1" type="text" class="form_1"  size="30" value="<?=$sqlfetcharray2[firstname]?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Last Name : </td>
                                          <td height="25" align="left" valign="middle"><input name="lastname1" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2[lastname]?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Address  :</td>
                                          <td height="25" align="left" valign="middle"><input name="address21" type="text" class="form_1"  size="30"   value="<?=$sqlfetcharray2[address]?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Email Id : </td>
                                          <td height="25" align="left" valign="middle"><input name="bemail" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['emailid']?>" /></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text">Country : </td>
                                          <td height="25" align="left" valign="middle"><select name="country1"   onchange="changeState1();">
                                              <option value="" selected="selected">--select--</option>
                                              <?php
	if($sqlfetcharray2['country'])
	{
	?>
      <option value="<?=$sqlfetcharray2['country']?>" selected="selected">
   <?=$sqlfetcharray2['country']?>
      </option>
      <?	} ?>
	
	<?php /*?>foreach($totalcountry as $val){ if($val!=$sqlfetcharray2['country']) {?>
      <option value="<?=$val?>">
    <?=$val?>
    </option>
    <?php } }?><?php */?>

     </select>                                          </td>
                                          </tr>
<tr>
<td width="229" height="25" align="right" valign="middle" class="inner_product_text">State : </td>
<td height="25" align="left" valign="middle"><table width="50%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" id="display" style="display:none;"><select name="state2" id="state2"  class="select" >
<option value="" selected="selected">--select--</option>
</select>                                                </td>
<td align="left" id="display2" style="display"><input type="text" name="state3"  value="<?=$sqlfetcharray2['state']?>" size="30"  /></td>
</tr>
</table></td>
</tr>
                                        <tr>
                                          <td width="229" height="25" align="right" valign="middle" class="inner_product_text"> ZipCode : </td>
                                          <td height="25" align="left" valign="middle"><input name="zip1" type="text" class="form_1"  size="30"  value="<?=$sqlfetcharray2['zipcode']?>"/></td>
                                        </tr>
                                        <tr>
                                          <td width="229" height="22" align="right" valign="middle" class="inner_product_text">Phone :</td>
                                          <td height="22" align="left" valign="middle"><input name="phone1" type="text" class="form_1"  size="30" maxlength="20"  value="<?=$sqlfetcharray2['phoneno']?>" /></td>
                                        </tr>
                  </table>

actually this total code is in one form. in that form last submit button is there.

when i am removing javascript code is working with out error.

actually this total code is in one form. in that form last submit button is there.

That's the code I care about, what you posted above is just the html to display, the processing code is somewhere else.
I mean code like below -
if(isset($_POST) )
{
//your code
}
post that code

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.