Current location: Hot Scripts Forums » General Web Coding » JavaScript » how do i get dynamic forms working with mozilla firefox?? please help!!!


how do i get dynamic forms working with mozilla firefox?? please help!!!

Reply
  #1 (permalink)  
Old 01-13-06, 09:42 AM
manu0310 manu0310 is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-18-06, 10:47 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
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.

Try doing doument.forms['formInput'].numberQs.value instead.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla released FireFox 1.5 ashish The Lounge 9 01-18-06 10:58 PM
Dreamweaver and Mozilla Firefox goofy New Members & Introductions 2 08-23-05 03:58 AM
onChange with 2 values not working in FireFox dooby JavaScript 2 07-09-05 01:05 PM
Dynamic Forms websmart PHP 0 03-26-05 12:59 AM
IE and Firefox not working together stuboo CSS 2 11-29-04 03:49 AM


All times are GMT -5. The time now is 11:06 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.