Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Ďalšie informácie

Dynamic created control in java script is not passing to next page

  • 1 odpoveď
  • 1 má tento problém
  • 1 zobrazenie
  • Posledná odpoveď od Maudib11

more options

while I am try to get its value on next page after submission, dynamic created control is not accesible. Its working fine in IE


<script> function myfunction(){

var element = document.createElement("input");

   //Assign different attributes to the element.
   element.setAttribute("type", "text");
   element.setAttribute("value", "sdf");
   element.setAttribute("name", "mytxt");
   element.setAttribute("id", "mytxt");


    var myDiv=document.getElementById("mydiv");
    myDiv.appendChild(element);

} </script>

while I am try to get its value on next page after submission, dynamic created control is not accesible. Its working fine in IE <div id="mydiv" ></div> <script> function myfunction(){ var element = document.createElement("input"); //Assign different attributes to the element. element.setAttribute("type", "text"); element.setAttribute("value", "sdf"); element.setAttribute("name", "mytxt"); element.setAttribute("id", "mytxt"); var myDiv=document.getElementById("mydiv"); myDiv.appendChild(element); } </script>

Upravil(a) nix_solanki dňa

Všetky odpovede (1)

more options

I couldn't really see anything wrong with the code you supplied. Maybe you should show us the whole code to get further support.

Upravil(a) Maudib11 dňa