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 June 20th, 2004, 08:09 AM
Iconoklast Iconoklast is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Iconoklast User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
can I create new <input>'s after selecting an option?

Allo,
I was wondering if there was a way to create a specific amount of new <input type="text"> tags after selecting a number from a <select> form?
For example, say I had 3 options in a select tag:
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>

now, depending on which number I choose, it creates that amount of <input> fields for me to use in a form?

Thanks!

Reply With Quote
  #2  
Old June 20th, 2004, 03:02 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
yes, you can either do it client-side with javascript using document.write, or server-side with VBScript using Response.write.

Reply With Quote
  #3  
Old June 21st, 2004, 08:41 AM
scrubs scrubs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 42 scrubs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Do you want to add the inputs to the current document, or do you want to create a new document with those inputs?

Reply With Quote
  #4  
Old June 21st, 2004, 12:12 PM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
You can also use client-side script with vbscript. You would need to use DHTML.

Reply With Quote
  #5  
Old June 21st, 2004, 12:33 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
Quote:
Originally Posted by spak111
You can also use client-side script with vbscript. You would need to use DHTML.

However, it isn't recommended to use VBScript client-side, since not all browsers support VBScript as a client-side scripting language.

Reply With Quote
  #6  
Old June 21st, 2004, 01:11 PM
spak111 spak111 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 349 spak111 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 25 sec
Reputation Power: 5
Send a message via AIM to spak111
Never said that it was suggested, just said that it is possible to use

Reply With Quote
  #7  
Old June 23rd, 2004, 03:18 PM
Iconoklast Iconoklast is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 Iconoklast User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
do you guys know how? or could direct me to a site that explains how? I'm not too familiar with Javascript or VB ;p

Reply With Quote
  #8  
Old June 24th, 2004, 10:51 AM
scrubs scrubs is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 42 scrubs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
This should work for javascript:

<script>
function addInputElement(num){
inputElements.innerHTML='';
for(x=0;x<num;x++)inputElements.innerHTML=inputElements.inne rHTML +"<input value="+x+"><BR>"
}
</script>
<P>
<select name=select1 onchange='addInputElement( select1.value )'>
<option value=0>none</option>
<option value=1>one</option>
<option value=2>two</option>
<option value=3>three</option>
</select>
</P>
<P>
<form id=form1 name=form1>
<div id=inputElements>&nbsp;</div>
</form>
</p>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > can I create new <input>'s after selecting an option?


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


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





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