| | |
create dynamic fields
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved
![]() |
hiii
i have a field called
DRIVE ACCESS
under it user enters
PATH
DATE
what i want is that when user click on +
two new boxes open which allow him to enter the details for second DRIVE
basically i want to enter text boxes dynamically using javascript....
any ideas
thanks....
i have a field called
DRIVE ACCESS
under it user enters
PATH
DATE
what i want is that when user click on +
two new boxes open which allow him to enter the details for second DRIVE
basically i want to enter text boxes dynamically using javascript....
any ideas
thanks....
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
I'm really out of concept, but i hope this help:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml-stylesheet type="text/css" href="#css21" media="screen"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html id="xhtml10S" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://www.w3.org/2005/10/profile"> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Window-Target" content="_top" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Free Live Help!</title> <style id="css21" type="text/css" media="screen"> /* <![CDATA[ */ table { margin : 0 auto; color : #405060; letter-spacing : 2px; border : 1px solid #aaa; empty-cells : show; border-collapse : collapse; width : 98%; } td { padding : .500em 1em .500em 1em; border-bottom : 1px solid #aaa; } td:first-child { background-color : #f7f7f7; text-align : center; width : 25%; border-right : medium groove #aaa; padding : 0; } tr { line-height : 1.6 } /* ]]> */ </style> <script id="javascriptV15" type="text/javascript"> // <![CDATA[ var div; var transform = function() { var input = "<label>Drive Label: <input type=\"text\" size=\"30\" value=\"\" onchange=\"div.innerHTML = '[ ' + this.value + ' ]';\" /></label>"; this.innerHTML = input; }; var convert = function() { div = (( document.getElementById ) ? document.getElementById("inputTest") : document.all.inputTest ); div.onclick = transform; }; window.onload = convert; // ]]> </script> </head> <body> <form method="post" id="form1" action="#" onsubmit="return false;"> <div id="inputTest">[ CLICK & ENTER TEXT ]</div> </form> </body> </html>
Dev.Opera — FOLLOW THE STANDARDS, BREAK THE RULES...
You can use this simple method to add new text boxes: -
javascript Syntax (Toggle Plain Text)
/* container - HTML element in which textBox needs to be added labelString - (optional) Label string for text box textValue - (optional) Text value for text box */ function addNewTextBox(container, labelString, textValue) { if(!container) { return false; } // Create Label var label = document.createElement('label'); label.value = (lableString ? labelString : 'Label'); // Create Text box var textBox = document.createElement('input'); textBox.type = 'text'; label.value = (textValue ? textValue: ''); container.appendChild(label); container.appendChild(textBox); return textBox; }
When you think you have done a lot, then be ready for YOUR downfall.
•
•
•
•
You can use this simple method to add new text boxes: -
javascript Syntax (Toggle Plain Text)
/* container - HTML element in which textBox needs to be added labelString - (optional) Label string for text box textValue - (optional) Text value for text box */ function addNewTextBox(container, labelString, textValue) { if(!container) { return false; } // Create Label var label = document.createElement('label'); label.value = (lableString ? labelString : 'Label'); // Create Text box var textBox = document.createElement('input'); textBox.type = 'text'; label.value = (textValue ? textValue: ''); container.appendChild(label); container.appendChild(textBox); return textBox; }
the code i have which needs to be repeated is :
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<table width="85%" border=0 align="center" cellPadding=2 cellSpacing=1 bgcolor="#ffffff" id=TABLE01> <td height="25" bgColor=#eeeeee class='cellDesc' width="35%"><font color="BLACK"><strong>SHARED DRIVE ACCESS </strong></font></td> <tr> <td height="25" bgColor=#eeeeee class='cellDesc' width="35%">Drive Name<font color='#ff0000'>*</font></td> <td bgColor=#eeeeee> <% if len(sessionNum)>0 then %> <input name='drive_name' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Number" value="<%=rsData.fields("drive_name")%>" tabIndex=1 > <% ELSE %> <input name='drive_name' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Ticket Number" tabIndex=1> <% END IF %> </td> </tr> <tr> <td height="25" bgColor=#eeeeee class='cellDesc' width="35%">Drive Access Add, Ticket Number<font color='#ff0000'>*</font></td> <td bgColor=#eeeeee > <% if len(sessionNum)>0 then %> <input name='ge_sso_id' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Drive " value="<%=rsData.fields("drive_add_ticket_no")%>" > <% ELSE %> <input name='drive_add_ticket_no' class='cellData' maxlength="30" style="WIDTH: 302px; HEIGHT: 17px" size=45 title="Enter Drive" value="" > <% END IF %> </td> </tr> <!-- Date Of Request --> <tr bgColor=#eeeeee> <td width="35%" class='cellDesc'>Date Of Drive Add Request <font color='#ff0000'>*</font></td> <td> <% if len(sessionNum)>0 then %> <input name='drive_add_date' class='cellData' readonly title="Date Of Request" value= <%=doj%> > <A onmouseover="window.status ='Date Picker';return true;" onmouseout="window.status='';return true;" href="javascript:show_calendar('access.drive_add_date','mm-dd-yyyy');" > <IMG src="images/calendar.png" align=middle border=0 tabIndex=9> </A> <% ELSE %> <input name='drive_add_date' class='cellData' readonly title="Date Of Request" > <A onmouseover="window.status ='Date Picker';return true;" onmouseout="window.status='';return true;" href="javascript:show_calendar('access.drive_add_date','mm-dd-yyyy');" > <IMG src="images/calendar.png" align=middle border=0 tabIndex=9> </A> <% END IF %> </td> </tr> </table>
i need this to be repeated as required and then
also Save these values in the database
i can't think how am i gonna send multiple enteries into the database..
Last edited by aashishn86; Jul 7th, 2009 at 6:44 am.
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
![]() |
Similar Threads
- how to create a dynamic dropdownlist? (ASP.NET)
- create dynamic link without creating new php page?? (PHP)
- function to read in data and create dynamic array of pointers (C++)
- how to create the dynamic object using C# (C#)
- how to create C# dynamic Module in DNN 4.0.0 (C#)
- how to create a dynamic string array to store string items . plz (C++)
- create dynamic reports in asp.net (ASP.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: prOblem wIth DynAmiC aDDition Of Rows !!
- Next Thread: Form button just stopped working
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug captchaformproblem checkbox close codes createrange() css cursor debugger decimal dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem paypal pdf php player position problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n





