Frknozsoy adlı üyeden alıntı: mesajı görüntüle
Malesef Çalışmadı Bu Şekilde Yaptım Ama Sizce Sorun Nedir?

Teşekkürler..



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
$("select[name=selectmenu1]").change(function(){
    var id=$("option:selected",this).attr("id");
    
    if(id=="ac"){
        $("#tab").show();
    }
	else if(id=="kapa"){
        $("#tab").hide();
    }
});
</script>


</head>

<body>

<table width="60%" border="1">
  <tr>
    <td>Company Name :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Company Brief :</td>
    <td colspan="2"><form id="form1" name="form1" enctype="multipart/form-data" method="post" action="">
      <label for="dosya"></label>
      <input type="file" name="dosya" id="dosya" />
    </form></td>
  </tr>
  <tr>
    <td> Brand</td>
    <td><select name="selectmenu">
    <option>Our Label  </option>
     <option>Your Label  </option>
    </select></td>
     <td>&nbsp;</td>
  </tr>
  <tr>
    <td>First Name :</td>
    <td><form id="form2" name="form2" method="post" action="">
      <input type="checkbox" name="checkboxlist" id="checkboxlist" />
      <label for="checkboxlist"> Mr.</label>
      
       <input type="checkbox" name="checkboxlist" id="checkboxlist" />
      <label for="checkboxlist"> Ms.</label>
    
    </form></td>
     <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Last Name :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Customer Type :</td>
    <td colspan="2">
 <select name="selectmenu1">
 <option id="kapa">Distributor  </option>
 <option id="ac">Market  </option>

 </select>
    </td>
  </tr>
  <tr id="tab" >
    <td >
    
     Number of department stores :</td>
    <td colspan="2">  Eğer market seçeneği tıklanırsa çıkacak <input type="text" /></td>
  </tr>
  <tr>
    <td> Country :</td>
    <td colspan="2">
    <select name="selectmenu2">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>City :</td>
    <td colspan="2"><select name="selectmenu3">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>Province :</td>
    <td colspan="2"><select name="selectmenu4">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>Address :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Telephone :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Mobile Phone :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Fax :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Zip Code :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Web Site :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>E-mail :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Products :</td>
    <td colspan="2"><label for="dosya1"></label>
      <input type="file" name="dosya" id="dosya1" />
    </form></td>
  </tr>
  <tr>
    <td> Packaging Design :</td>
    <td colspan="2"><label for="dosya2"></label>
      <input type="file" name="dosya" id="dosya2" />
    </form></td>
  </tr>
  <tr>
    <td> Port of destinations :</td>
    <td colspan="2"><select name="selectmenu5">
      <option>Turkey </option>
      <option>U.S.A </option>
      <option>U.K. </option>
      <option>Syria </option>
      <option> Egypt</option>
      <option> Germany</option>
      <option> Holland </option>
      <option> Czech Republic</option>
    </select><label for="dosya4"></label>
      <input type="file" name="dosya" id="dosya4" />
    </form> </td>
  </tr>
  <tr>
    <td> Specifications Of Product :</td>
    <td colspan="2"><label for="dosya3"></label>
      <input type="file" name="dosya" id="dosya3" />
    </form></td>
  </tr>
  <tr>
    <td>Purchasing Capacity (Yearly) :</td>
    <td><select name="selectmenu6">
    <option>20"container</option>
     <option>40"container </option>
      <option> 40" hq container</option>
    </select></td>
     <td>&nbsp;</td>
  </tr>
 
</table>
<input type="button" value="Gönder" />
</body>
</html>
1.
<select name="selectmenu1">
olan kısmı
<select name="selectname1" id="selectname1">
olarak değiştir.

2. selectmenu1 in altındaki option ların id değerlerini kaldır ve value değerleri ekle yoksa selectbox bi işe yaramaz.

3. aşağıdaki kodu jquery i ekledikten sonra sayfana ekle.

<script type="text/javascript">
	$(document).ready(function(){
		$("#selectmenu1").change(function(){
			if($("#selectmenu1").val()=="Market")
				$("#tab").hide();
			else
				$("#tab").show();
		});
	});

</script>
4. Tamamının çalışır hali
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#selectmenu1").change(function(){
			if($("#selectmenu1").val()=="Market")
				$("#tab").hide();
			else
				$("#tab").show();
		});
	});

</script>


</head>

<body>

<table width="60%" border="1">
  <tr>
    <td>Company Name :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Company Brief :</td>
    <td colspan="2"><form id="form1" name="form1" enctype="multipart/form-data" method="post" action="">
      <label for="dosya"></label>
      <input type="file" name="dosya" id="dosya" />
    </form></td>
  </tr>
  <tr>
    <td> Brand</td>
    <td><select name="selectmenu">
    <option>Our Label  </option>
     <option>Your Label  </option>
    </select></td>
     <td>&nbsp;</td>
  </tr>
  <tr>
    <td>First Name :</td>
    <td><form id="form2" name="form2" method="post" action="">
      <input type="checkbox" name="checkboxlist" id="checkboxlist" />
      <label for="checkboxlist"> Mr.</label>
      
       <input type="checkbox" name="checkboxlist" id="checkboxlist" />
      <label for="checkboxlist"> Ms.</label>
    
    </form></td>
     <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Last Name :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Customer Type :</td>
    <td colspan="2">
 <select name="selectmenu1" id="selectmenu1">
 <option id="kapa">Distributor  </option>
 <option id="ac">Market  </option>

 </select>
    </td>
  </tr>
  <tr id="tab" >
    <td >
    
     Number of department stores :</td>
    <td colspan="2">  Eğer market seçeneği tıklanırsa çıkacak <input type="text" /></td>
  </tr>
  <tr>
    <td> Country :</td>
    <td colspan="2">
    <select name="selectmenu2">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>City :</td>
    <td colspan="2"><select name="selectmenu3">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>Province :</td>
    <td colspan="2"><select name="selectmenu4">
    <option>Turkey </option>
       <option>U.S.A  </option>
     <option>U.K.  </option>
      <option>Syria </option>
       <option>  Egypt</option>
       <option> Germany</option>
       <option> Holland </option>
       <option>  Czech Republic</option>
  
    </select></td>
  </tr>
  <tr>
    <td>Address :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Telephone :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Mobile Phone :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Fax :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>Zip Code :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Web Site :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td>E-mail :</td>
    <td colspan="2"><input type="text" /></td>
  </tr>
  <tr>
    <td> Products :</td>
    <td colspan="2"><label for="dosya1"></label>
      <input type="file" name="dosya" id="dosya1" />
    </form></td>
  </tr>
  <tr>
    <td> Packaging Design :</td>
    <td colspan="2"><label for="dosya2"></label>
      <input type="file" name="dosya" id="dosya2" />
    </form></td>
  </tr>
  <tr>
    <td> Port of destinations :</td>
    <td colspan="2"><select name="selectmenu5">
      <option>Turkey </option>
      <option>U.S.A </option>
      <option>U.K. </option>
      <option>Syria </option>
      <option> Egypt</option>
      <option> Germany</option>
      <option> Holland </option>
      <option> Czech Republic</option>
    </select><label for="dosya4"></label>
      <input type="file" name="dosya" id="dosya4" />
    </form> </td>
  </tr>
  <tr>
    <td> Specifications Of Product :</td>
    <td colspan="2"><label for="dosya3"></label>
      <input type="file" name="dosya" id="dosya3" />
    </form></td>
  </tr>
  <tr>
    <td>Purchasing Capacity (Yearly) :</td>
    <td><select name="selectmenu6">
    <option>20"container</option>
     <option>40"container </option>
      <option> 40" hq container</option>
    </select></td>
     <td>&nbsp;</td>
  </tr>
 
</table>
<input type="button" value="Gönder" />
</body>
</html>