HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 3rd, 2009, 04:53 AM
aashishnakra's Avatar
aashishnakra aashishnakra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 32 m 51 sec
Reputation Power: 75
Send a message via Yahoo to aashishnakra
Exclamation Create dynamic fields

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....
__________________
“Life may not be the party we hoped for, but while we are here we should sing, dance and be merry all the time......."

Reply With Quote
  #2  
Old July 3rd, 2009, 05:31 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,416 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 23 h 57 m 27 sec
Reputation Power: 1800
Heres an example that uses hidden divs and existing textboxes, its a bit static but it may give you some ideas:
Code:
<html>
<head>
<script>
var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
 browserType= "gecko"
}

function show(whichelement) {
  if (browserType == "gecko" )
     document.poppedLayer =
         eval('document.getElementById(whichelement)');
  else if (browserType == "ie")
     document.poppedLayer =
        eval('document.getElementById(whichelement)');
  else
     document.poppedLayer =
         eval('document.layers[whichelement]');
  document.poppedLayer.style.display = "inline";
}

</script>
</head>
<body>
<form name="DriveAccess" method="post" action="test2.asp">

<div id="drive1" style="display: inline">
	Path:&nbsp;<input type="text" name="path1">&nbsp;Date:&nbsp;<input type="text" name="date1">&nbsp;<a href="#" onclick="show('drive2');"><b>+</b></a>
</div><br>
<div id="drive2" style="display: none">
	Path:&nbsp;<input type="text" name="path2">&nbsp;Date:&nbsp;<input type="text" name="date2">&nbsp;<a href="#" onclick="show('drive3');"><b>+</b></a>
</div><br>
<div id="drive3" style="display: none">
	Path:&nbsp;<input type="text" name="path3">&nbsp;Date:&nbsp;<input type="text" name="date3">
</div>
</form>
</body>
</html>

Reply With Quote
  #3  
Old July 3rd, 2009, 06:19 AM
aashishnakra's Avatar
aashishnakra aashishnakra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 32 m 51 sec
Reputation Power: 75
Send a message via Yahoo to aashishnakra
Thumbs up

thanks SOS

its a good start.........
but it puts a maximum limit to the number of divs i can have....


i'll search a little...
and post back.

Reply With Quote
  #4  
Old July 3rd, 2009, 06:24 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,416 sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 23 h 57 m 27 sec
Reputation Power: 1800
Yesh, thats the limitation of this approach, you would have a maximum limit on the number of divs. Hopefully it will give you some ideas though.

Reply With Quote
  #5  
Old July 9th, 2009, 09:27 AM
aashishnakra's Avatar
aashishnakra aashishnakra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2009
Location: India
Posts: 316 aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level)aashishnakra User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 32 m 51 sec
Reputation Power: 75
Send a message via Yahoo to aashishnakra
Talking

Code:
function addRow()
{
  var tbl = document.getElementById('tblName');
  var lastRow = tbl.rows.length;
  // if there's no header row in the table, then iteration = lastRow + 1
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  
  // left cell
  var cellLeft = row.insertCell(0);
  var el = document.createElement('input');
  el.type = 'text';
  el.name = 'txtRow' + iteration;
  el.id = 'txtRow' + iteration;
  el.size = 45;
  el.style.color='blue'
  el.className="cellData";
  el.style.width="220px";
  el.maxlength=20;
  el.style.height="17px";
  cellLeft.appendChild(el);
}


This is what i found.....
it works great..........

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Create dynamic fields


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
Stay green...Green IT