User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,206 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,344 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 662 | Replies: 0
Reply
Join Date: Apr 2008
Posts: 14
Reputation: freshface001 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
freshface001 freshface001 is offline Offline
Newbie Poster

javascript variale does not pass in url please help me to find out the solution

  #1  
May 16th, 2008
hi to all
my problem
when i add form field dynamically to the page in java script (form method is get )it is well worked in IE but not working in mozilla fire fox problem is ,does not pass the form field element value to the url for the use of next page how to solve it please help me im new to java script
and my code is
  1. <script type="text/javascript">
  2.  
  3. var limit_number=<? echo $num;?>;
  4. var fileId = 2;
  5. function addElement(parentId, elementTag, elementId, html) {
  6. // Adds an element to the document
  7. var p = document.getElementById(parentId);
  8. var newElement = document.createElement(elementTag);
  9. newElement.setAttribute('id', elementId);
  10. newElement.setAttribute('name', elementId);
  11.  
  12. newElement.innerHTML = "Invitation EmailID "+ fileId+" : "+ html;
  13.  
  14. p.appendChild(newElement);
  15. fileId++;
  16. }
  17.  
  18. function removeElement() {
  19. if(fileId>2){
  20. // Removes an element from the document
  21. var element = document.getElementById("invite"+(fileId-1));
  22. element.parentNode.removeChild(element);
  23. fileId--;
  24. }
  25. }
  26.  
  27. function addFile() {
  28. if((limit_number+fileId)<11){
  29. //
  30. // Example function showing how to add a file input box to an existing form
  31. //
  32. // increment fileId to get a unique ID for the new element
  33. var html = '<input type="text" name="invite'+fileId+'" class="txtbox"/> ' +
  34. '';
  35. addElement('files', 'p', 'invite' + fileId, html);
  36.  
  37. }
  38. else
  39. {
  40. alert("you can't invite more than 10");
  41. }
  42. }
  43.  
  44. function setavalue() {
  45.  
  46. document.getElementById('burns').value=fileId
  47. }
  48. </script>
and the html form is
  1. <table width="70%" align="center">
  2.  
  3. <tbody onClick="setavalue()">
  4. <form enctype="multipart/form-data" action="members.php" method="get" on>
  5. <tr>
  6. <td class="bluebar">Send Invitation</td>
  7. </tr>
  8. <tr class="box">
  9. <td style="padding-top:15px">
  10. Invitation EmailID 1 : <input name="invite1" type="text" class="txtbox" /></td>
  11. </tr>
  12. <tr><td>
  13. <div id="files">
  14. </div></td></tr>
  15. <tr>
  16. <td>&nbsp;</td>
  17.  
  18. </tr>
  19. <tr><td width="51%"> <a href="#" onclick="removeElement(); return false;">Remove</a>&nbsp;&nbsp;<input class="button" type="button" value="Add another ID"
  20. onclick="addFile();" />
  21. <input class="button" type="submit" value="Submit" name=send/><input type=hidden name=burns /></td>
  22. </tr>
  23. </form> <tr><td colspan="2"></tbody></table>
Last edited by peter_budo : May 16th, 2008 at 6:48 am. Reason: Keep It Organized - please use [code] tags
Thanks and regards,
Suresh Kumar.R
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

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

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 2:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC