•
•
•
•
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
![]() |
•
•
Join Date: Apr 2008
Posts: 14
Reputation:
Rep Power: 1
Solved Threads: 1
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
and the html form is
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
JavaScript Syntax (Toggle Plain Text)
<script type="text/javascript"> var limit_number=<? echo $num;?>; var fileId = 2; function addElement(parentId, elementTag, elementId, html) { // Adds an element to the document var p = document.getElementById(parentId); var newElement = document.createElement(elementTag); newElement.setAttribute('id', elementId); newElement.setAttribute('name', elementId); newElement.innerHTML = "Invitation EmailID "+ fileId+" : "+ html; p.appendChild(newElement); fileId++; } function removeElement() { if(fileId>2){ // Removes an element from the document var element = document.getElementById("invite"+(fileId-1)); element.parentNode.removeChild(element); fileId--; } } function addFile() { if((limit_number+fileId)<11){ // // Example function showing how to add a file input box to an existing form // // increment fileId to get a unique ID for the new element var html = '<input type="text" name="invite'+fileId+'" class="txtbox"/> ' + ''; addElement('files', 'p', 'invite' + fileId, html); } else { alert("you can't invite more than 10"); } } function setavalue() { document.getElementById('burns').value=fileId } </script>
html Syntax (Toggle Plain Text)
<table width="70%" align="center"> <tbody onClick="setavalue()"> <form enctype="multipart/form-data" action="members.php" method="get" on> <tr> <td class="bluebar">Send Invitation</td> </tr> <tr class="box"> <td style="padding-top:15px"> Invitation EmailID 1 : <input name="invite1" type="text" class="txtbox" /></td> </tr> <tr><td> <div id="files"> </div></td></tr> <tr> <td> </td> </tr> <tr><td width="51%"> <a href="#" onclick="removeElement(); return false;">Remove</a> <input class="button" type="button" value="Add another ID" onclick="addFile();" /> <input class="button" type="submit" value="Submit" name=send/><input type=hidden name=burns /></td> </tr> </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
Suresh Kumar.R
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- Previous Thread: getElementById
- Next Thread: Help Postioning Sidebar on screen. OPEN ME!


Linear Mode