This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Cuireadh an snáithe seo sa chartlann. Cuir ceist nua má tá cabhair uait.

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

  • 1 freagra
  • 1 leis an bhfadhb seo
  • 1 view
  • Freagra is déanaí ó 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>

Athraithe ag nix_solanki ar

All Replies (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.

Athraithe ag Maudib11 ar