html selectbox ve php uygulaması

Bu soru iptal edilmiştir...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Select Drop Down Skin</title>
    <style>
    <!--
      @import url('./css/select-skin.css');
      body {
        background: #fff;
        font-size: 12px;
        font-family: Tahoma, Verdana, Arial;
      }
    //-->
    </style>
    <script src="./js/select-skin.js" type="text/javascript" language="JavaScript"></script>
  </head>
  <body>
    <h3>One</h3>
    <p>
      <div class="skinnedSelect">
        <div class="text" id="text1">One</div>
      	<select name="name" onChange="setText('text1', this);">
      		<option value="One">One</option>
      		<option value="Two">Two</option>
      		<option value="Thre">Three</option>
      	</select>
      </div>
    </p>
    <h3>Two</h3>
    <p>
      <div class="skinnedSelect">
        <div class="text" id="text2">Two</div>
    
      	<select name="name2" onChange="setText('text2', this);">
      		<option value="1">One</option>
      		<option value="2">Two</option>
      		<option value="3">Three</option>
      	</select>
      </div>
    </p>
    <h3>Three</h3>
    <p>
      <div class="skinnedSelect">
        <div class="text" id="text3">Three</div>
      	<select name="name3" onChange="setText('text2', this);">
      		<option value="1">One</option>
      		<option value="2">Two</option>
      		<option value="3">Three</option>
      	</select>
      </div>
    </p>
  </body>

burdaki örneği kendi yaptığım siteye uygulamak istiyorum fakat sürekli hata veriyor.
daha doğrusu <div class="text" id="text3">Three</div> bölümündeki yazı hiçbir zaman değişmiyor.
Bu da benim kodum:
<dil>    $dizin_adi = "../tema/";
    $dizin = opendir($dizin_adi);
    echo "<div class='skinnedSelect'><div class='text' id='text1'>..</div><select name='tema' onChange='setText('text1', this);'>";
    while(gettype($ad=readdir($dizin))!=boolean)
    {
        echo '<option value="'.$ad.'">'.$ad.'</option>';
    }
    echo '</select></div>';</dil>

css dosyası:
  /*
    
    NOTES
    -----
      -> MSIE7 + FF2 Compatible
    
      Class Information
      -----------------
      
      -> (div.skinnedSelect)
        -> Main Containing Skin with Image Applied
      -> (div.skinnedSelect select)
        -> Hidden select box using opacity and relative positioning.
      -> (div.skinnedSelect .text)
        -> Text container, holds the currently selected div.
      -> (div.skinnedSelect .text)
        -> Text container, holds the currently selected div.
            
  */
  
div.skinnedSelect {
	background: url('../resim/skin.png') no-repeat scroll 0pt 100%;
	height: 19px;
}
div.skinnedSelect select {
	opacity: 0;
	filter: alpha(opacity = 0);
	moz-opacity: 0;
	position: relative;
	left: -150px;
	z-index: 1;
}
div.skinnedSelect .text {
  float: left;
	text-indent: 10px;
	line-height: 19px;
	width: 150px;
}
div.skinnedSelect .text,
div.skinnedSelect select,
div.skinnedSelect select option {
	width: 150px;
	font-size: 11px;
	color: #316D89;
}

js dosyası:
  /************************************************************\
  *
  *    Skinned Select Box Copyright 2007 Derek Harvey
  *		 www.lotsofcode.com
  *
  *    This file is part of Skinned Select Box .
  *
  *    Skinned Select Boxis free software; you can redistribute it and/or modify
  *    it under the terms of the GNU General Public License as published by
  *    the Free Software Foundation; either version 2 of the License, or
  *    (at your option) any later version.
  *
  *    Skinned Select Box is distributed in the hope that it will be useful,
  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *    GNU General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with Skinned Select Box; if not, write to the Free Software
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  \************************************************************/
  
  // DEVELOPER NOTES
  // ===============
  
  // setText() Function for changing the text value of the selected item
  // This is reqired because the opacity for the select box
  // is set to "0", so we will not be able to see the value without this.
  
  // usage: setText(element [string], selectedOption [object])
  // example (applied to select box): 
  //  ->  setText('text1', this); - Uses current object as passing reference
  // example (onloaded): 
  //  ->  setText('text1', document.formName.elementName.selectedIndex); - Uses form element object as passing reference
  
  function setText(a, b)
  {
    x = document.getElementById(a);
    if (x)
      x.innerHTML = b.options[b.selectedIndex].innerHTML;
  }
+0
-0
Cevaba KatılıyorumKatılmıyorum
Cevap Yaz Yorum Yaz Arşivime Ekle Takip Et

Cevaplar

  • 98oktay adlı üyenin fotoğrafı
    12 yıl önce yazılmış
    12 cevap - 0 soru
    merhaba kodlarda ilk başta bişey farkettim iki selectboxda da
    onChange = "setTex t ('text2',this);" kullanmışsn text3 o yüzden değişmiyo olabilir..

    Not: xhtml kullanıyosun "onChange" yerinde tümü küçük harf kullansan daha iyi olur (onchange)..
    • tahsingokalp adlı üyenin fotoğrafı tahsingokalp
      sanırım soruyu yanlış yazmışım
      ilk sıradaki örnek htmldi o sayfayı kullandığımda selectboxlar çalışıyor.
      fakat ben aşağıdaki php kodunu yazdığımda selectbox bir türklü değişmiyor her zaman 2. yazdığım div in içindeki yazı oluyor
      12 yıl önce yazılmış
  • necmettin adlı üyenin fotoğrafı
    12 yıl önce yazılmış
    80 cevap - 0 soru
    name3 selectinde text2 içeriğini değiştiriyorsun, o yüzden değişmiyor...