hay pardeep how u doing what u up 2.....i ahve written the codes but there seems to be sum problem. can u check please...

thanks alot
shaz



HTML Code:
<html>

<head>

<title>Search Form</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

body {

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;

}



.box {

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;

    border: 1px solid #000000;



}



.bluebox {

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;

    font-weight: bolder;

    color: #FFFFFF;

    background-color: #006699;

    border: 1px solid #000000;

}



.maincell {

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;

    padding: 5px;

    border: 1px solid #006699;

}



.errmsg {

    font-family: "Courier New", Courier, mono;

    font-size: 12px;

    font-weight: bolder;

    color: #CC0000;

}

</meta>

</style>

<script language="JavaScript">

function checkForm()

{

    var ccity, carea, cpostcode, cminprice, cmaxprice;

    with(window.document.searchform)

    {

        ccity    = city;

        carea   = area;

        cpostcode = postcode;

        cminprice = minprice;

        cmaxprice = maxprice;

    }

    

    if(trim(ccity.value) == '')

    {

        alert('Please enter city');

        ccity.focus();

        return false;

    }

    else if(trim(carea.value) == '')
    {

        alert('Please enter area');

        carea.focus();

        return false;

    }

    else if(trim(cpostcode.value) == '')

    {

        alert('Please enter postcode');

        cpostcode.focus();

        return false;

    }

    else if(trim(cminprice.value) == '')

    {

        alert('Please enter minimum price');

        cminprice.focus();

        return false;

    }

    else if(trim(cmaxprice.value) == '')

    {

        alert('Please enter maximum price');

        cmaxprice.focus();
        return false;

    }

    else

    {

        ccity.value    = trim(ccity.value);

        carea.value   = trim(carea.value);

        cpostcode.value = trim(cpostcode.value);

        cminprice.value = trim(cminprice.value);

	cmaxprice.value = trim(cmaxprice.value);

        return true;

    }

}



/*

Strip whitespace from the beginning and end of a string

Input : a string

*/

function trim(str)

{

    return str.replace(/^\s+|\s+$/g,'');

}





</script>

</head>



<body>

<?php



$errmsg  = ''; // error message

$city   = ''; // city

$area   = ''; // area

$postcode = ''; // postcode

$minprice = ''; // minprice

$maxprice = ''; // maxpricewebsite development



if(isset($_POST['send']))

{

    $city  = $_POST['city'];

    $area   = $_POST['area'];

    $postcode = $_POST['postcode'];

    $minprice = $_POST['minprice'];

    $maxprice = $_POST['maxprice'];



    if(trim($city) == '')

    {

        $errmsg = 'Please enter city';

    } 

    else if(trim($area) == '')
   {

        $errmsg = 'Please enter area';

    }

   

	else if(trim($postcode) == '')

    {

        $errmsg = 'Please enter postcode';

    }

    else if(trim($minprice) == '')

    {

        $errmsg = 'Please enter minimum price';

    }

    else if(trim($maxprice) == '')

    {

        $errmsg = 'Please enter maximum price';

    }

    

    if($errmsg == '')

    {

        if(get_magic_quotes_gpc())

        {

            $minprice = stripslashes($minprice);

            $maxprice = stripslashes($maxprice);

        }    

        

        

?>



<?php

    }

}





if(!isset($_POST['send']) || $errmsg != '')

{

?>

<div align="center" class="errmsg"><?=$errmsg;?></div>

<form  action= "http://mudfoot.doc.stu.mmu.ac.uk/students/shaikhs/searchform2.php" method="post" name="searchform" id="searchform">

  <table width="500" border="0" align="center" cellpadding="2" cellspacing="1" class="maincell">

    <tr> 

      <td width="106">Select Region</td>

      <td width="381"><input name="region" type="radio"  id="region"  value="London" checked> London

		       <td><input name="region" type="radio"  id="region"  value="England"> England

			<td><input name="region" type="radio"  id="region"  value="<Scotland>"> Scotland

			<td><input name="region" type="radio"  id="region"  value="Wales"> Wales

			website development<td><input name="region" type="radio"  id="region"  value="Northern Ireland" checked> Northern Ireland



</td>

    </tr>

    <tr> 

      <td>City</td>

      <td><input name="city" type="text" class="box" id="city" size="30" value="<?=$city;?>"></td>

    </tr>

    <tr> 

      <td>Area</td>

      <td><input name="area" type="text" class="box" id="area" size="30" value="<?=$area;?>"></td>

    </tr>

<tr>

<td>Min No.Of Bedrooms</td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="7" checked> 7 </td>

		     

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="6"> 6 </td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="5"> 5 </td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="4"> 4 </td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="3"> 3 </td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="2"> 2 </td>

	<td><input name="bedrooms" type="radio"  id="bedrooms"  value="1"> 1 </td>





  </tr>



	<tr> 

      <td>Postcode</td>

      <td><input name="postcode" type="text" class="box" id="postcode" size="10" value="<?=$postcode?>"></td>

    </tr>

<tr>

	<td>Property Type</td>

	<td><input name="type" type="radio"  id="type"  value="Flat" checked> Flat </td>

	

	<td><input name="type" type="radio"  id="type"  value="terrace"> Terrace </td>

    <td>    <input name="type" type="radio"  id="type"  value="house" > house </td>	     

	  </tr>



<tr> 

      <td>Minimum Selling price</td>

      <td><input name="minprice" type="text" class="box" id="minprice" size="30" value="<?=$minprice;?>"></td>

    </tr>





<tr> 

      <td>Maximum Selling price</td>

      <td><input name="maxprice" type="text" class="box" id="maxprice" size="30" value="<?=$maxprice;?>"></td>

    </tr>











    <tr align="center"> 

      <td colspan="2"><input name="search" type="submit" class="bluebox" id="search" value="Search Property" onclick="return checkForm();"></td>

    </tr>

      </table>

</form>





</body>

</html>

Last edited by shabbir; 28Nov2006 at 15:17.. Reason: Code formating.