Hi!
I've looked around for other people who've had this problem, but the answers I've seen don't really apply to the code I've written and I could really use some help.
I have a form that dynamically creates a textbox using:
<html><select name='sporty' id = 'sport' onclick= answer(this.options[this.selectedIndex].value)></html>
the function - answer - takes the value and calls another function:
<script type="text/javascript">
function OtherIndivAnswer()
{
var IntPath = document.signup.position;
var TheOptions = IntPath.options.length;
document.signup.position.options.length = 0;
IntPath.options[IntPath.options.length] = new Option('N/A','NULL');
document.getElementById("cell").innerHTML = "<div id=\"myDiv\"><font face=\"Arial, Helvetica, sans-serif\" color=\"#ff00ff\">Enter Sport:</font></div>";
document.getElementById("cell2").innerHTML = "<div id=\"myDiv\"><input type = \"text\" name = \"other_sport\" maxlength=\"100\"/></div>";
}
</script>
What I need to do is somehow get the value from cell2 to pass when the form is submitted to my php script. I've confirmed that the value is not in $HTTP_POST_VARS.
My only real idea is to pass it as a hidden value, but when I added the following lines to function OtherIndivAnswer()
<script type="text/javascript">
var the_sport =document.getElementById("cell2").value;
document.signup.write('<input type="hidden" name="the_sport" value="' + the_sport + '">');
</script>
nothing really changed.
If anyone could help I'd really appreciate it - I didn't post the entire script because it is huge, but if someone wanted to see it in full, I'll go ahead and do that.
I've looked around for other people who've had this problem, but the answers I've seen don't really apply to the code I've written and I could really use some help.
I have a form that dynamically creates a textbox using:
<html><select name='sporty' id = 'sport' onclick= answer(this.options[this.selectedIndex].value)></html>
the function - answer - takes the value and calls another function:
<script type="text/javascript">
function OtherIndivAnswer()
{
var IntPath = document.signup.position;
var TheOptions = IntPath.options.length;
document.signup.position.options.length = 0;
IntPath.options[IntPath.options.length] = new Option('N/A','NULL');
document.getElementById("cell").innerHTML = "<div id=\"myDiv\"><font face=\"Arial, Helvetica, sans-serif\" color=\"#ff00ff\">Enter Sport:</font></div>";
document.getElementById("cell2").innerHTML = "<div id=\"myDiv\"><input type = \"text\" name = \"other_sport\" maxlength=\"100\"/></div>";
}
</script>
What I need to do is somehow get the value from cell2 to pass when the form is submitted to my php script. I've confirmed that the value is not in $HTTP_POST_VARS.
My only real idea is to pass it as a hidden value, but when I added the following lines to function OtherIndivAnswer()
<script type="text/javascript">
var the_sport =document.getElementById("cell2").value;
document.signup.write('<input type="hidden" name="the_sport" value="' + the_sport + '">');
</script>
nothing really changed.
If anyone could help I'd really appreciate it - I didn't post the entire script because it is huge, but if someone wanted to see it in full, I'll go ahead and do that.