how do i get dynamic forms working with mozilla firefox?? please help!!!
hey guys I am generating a dynamic form on button click .. (onClick) ... i want to capture dynamic input so that once i click on the submit button a dynamic form is created .. this works fine in IE but not firefox. Here is 1 function that tries to use nQuestions as a value to generate the dynamic form... I didnt post the rest but please let me know if any1 can resolve this issue!!!!
Code:
function inputQuestions()
{
nQuestions = document.formInput.numberQs.value;
//nQuestions = 3; if i assign a static value it works...
// Check for numeric characters
if(!isNum(nQuestions))
{
document.formInput.numberQs.value = '';
document.formInput.numberQs.focus();
alert("Please enter a numeric value from 3 to 100 for the number of questions.");
}
else
{
//print document.formInput.numberQs.value;
if(nQuestions >= 3 && nQuestions <= 100)
{
iFrame.innerHTML = "<IFRAME SRC=\"content_input.php?id=<?PHP print($_SESSION['fName']); ?>&numQs=" + nQuestions + "\" WIDTH=\"100%\" HEIGHT=\"100%\" ALIGN=\"center\">";
document.formInput.buttonInput.value = "Change Number of Questions";
return;
}
// Check for empty
if(nQuestions == "")
{
alert('Please enter the number of questions you wish to input.');
document.formInput.numberQs.focus();
}
else
{
alert("Please enter a value from 3 to 100 for the number of questions.");
}
}
}
Last edited by TwoD; 01-18-06 at 10:40 AM.
Reason: please use the [code] wrapper
This is probably a referencing problem. IE is much more tolerant when it comes to referencing elements on a page. (This can sometimes cause interference with variable names). This is a feature that shouldn't be used in IE because it stops other browsers from finding the elements.