I want to create a simple formular which leads the user to 2 different pages (depending on what they choose). I'am using getElementById.innerHTML to differ the code within the site to create the two different <form action="SENDTHEUSERHERE" method="POST">-HTML-Elements.
Here's the code:
if (blabla which works)
{
document.getElementById("insert").innerHTML = "<form action='insert.php' method='POST'>";
}
else if (blabla which works)
{
document.getElementById("service").innerHTML = "<form action='service.php' method='POST'>";
}
// MORE BLABLA-CODE
<span id='insert'></span>
<span id='service'></span>
// REST OF THE FORMULAR
When I'am sending this formular, it leads me simply to the same page it was sent from. I guess that means, that those .innerHTML-Elements aren't recognized. Have you any suggestions how I can solve this? Btw.. yes, I'am a Javascript Noob -_-
Thanks for any help!