Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> textarea
barkroli
post
Post #1





Grupa: Zarejestrowani
Postów: 79
Pomógł: 0
Dołączył: 23.05.2004

Ostrzeżenie: (0%)
-----


Kod
<script type="text/javascript">
var ile = 0;

dodajInput = function(parentElement)
{
  ile++;
  var input   = document.createElement("input");
  input.type  = "text";
  input.name  = "kwota"+ile;
  parentElement.appendChild(input);
}

dodajText = function(parentElement)
{
  var input   = document.createElement("input");
  input.type  = "text";
  input.name  = "ulica"+ile;
  parentElement.appendChild(input);
}

Input = function(parentElement)
{
  var input   = document.createElement("input");
  input.type  = "hidden";
  input.name  = "ile";
  input.value = ile;
  parentElement.appendChild(input);
}

window.onload=function()
{
  var dodaj = document.getElementById('dodajInput');
  if(dodaj)
   {
    dodaj.onclick = function()
     {
      dodajInput(document.getElementById('dowozik'));
      Input (document.getElementById('dowozik'));
      dodajText(document.getElementById('dowozik'));
     }
   }
  else
   {
    return false;
   }
}
</script>

<form name="form" action="" method="POST">
<input type="button" id="dodajInput" value="dodaj pole pliku">
<div id="dowozik">
</div>
<input type="submit" name="x" value="y">
</form>

<?
for ($i=1; $i<=$_POST['ile'];$i++)
{
  echo $i."  --->  ".$_POST['kwota'.$i]."  --->  ".$_POST['ulica'.$i]."<br>";
}
?>


Mam coś takiego udało mi się stworzyć jak teraz zrobić żeby ten input który tworzony jest przez dodajText był <textarea> </textarea>


--------------------
Systemy dedykowane, Magento, Typo3
PascalSystem.pl
Go to the top of the page
+Quote Post

Posty w temacie
- barkroli   textarea   29.03.2006, 08:03:47
- - gekon   KoddodajText = function(parentElement) { ...   29.03.2006, 15:33:25


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 18:35