By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,143 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,143 IT Pros & Developers. It's quick & easy.

Javascript, FireFox, Form inside a function, problem.

P: 67
Well, I'm having a select drop down like this -

[HTML]<select name='xnum' onchange="callme(value,0,1,3)">
<option value='0'>0</option>
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
</select>[/HTML]

The function callme is like this -

Expand|Select|Wrap|Line Numbers
  1. function callme(x,y,s,f)
  2. {
  3.   var z=0;
  4.   var msg="",z=0;
  5.   z=eval(x)+eval(y);
  6.  
  7.   msg = '<table border="0" width="100%" align="center">';
  8.   for(k=y+1;k<=z;k++){
  9.       msg += "<tr><td align=\"center\" class=\"item\" style=\"font-weight:bold;\">Choix "+k+"&nbsp;&nbsp;<input type='text' name='choice[]' size='60'>&nbsp;</td></tr>";
  10.       }
  11.  
  12.         if ((s==1)&&(f!=5)) {
  13.             msg += "<tr><td align=\"center\" class=\"item\" style=\"font-weight:bold;\">Choix N&nbsp;&nbsp;<input type='text' name='texteextra' size='60'>&nbsp;</td></tr>";
  14.         }
  15.  
  16.  
  17.   msg += "</table>";
  18.   document.getElementById("showhere").innerHTML = msg;
  19. }
When a user select a any number from the drop down, that number of fields open up, what user can fill up and submit.

On form submit, I'm collecting the data by $_REQUEST['choice'] which is then getting stored to the database. Problem - it's working perfectly in IE7 where I've tested it. However, on checking the same on FF, I'm getting nothing inside $_REQUEST['choice'].

Any hints friends ?
Thanks. :)
Feb 3 '08 #1
Share this Question
Share on Google+
1 Reply


P: 67
solved :)

I was starting the <form> between <table> and <tr> ... he he ... very stupid mistake ...
Feb 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.