Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2005, 03:23 AM
Authorized User
 
Join Date: Jan 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamically generating text box.

i have a drop down box with a list of 20 products.i want that when i click to the 1st product 2 textboxes should be generated so that the user can enter the values.
when i click to another product then another set of 2 boxes shoudl appear...is it feasible??

thanks ...
 
Old January 20th, 2005, 08:50 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You Can do it.Create all the textboxes you want and onSelectionChange of dropdown list enable the textboxes you want.

 
Old January 20th, 2005, 09:53 AM
Authorized User
 
Join Date: Aug 2004
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As per my knowledge we have 2 ways to tackle this problem.

1.

  Create all the textboxes and keep it invisible.
  Keep in mind that each set should be in saparate "div" or "table" or "tr". You can apply style.display="none" to make these things invisible.
 Now on each selection make the appropriate sections visible.
 ie using style.display = "block".

  The only problem for this method is that it will cause some delay in brnging the page upto the browser

2. You can use HTML DOM.


 
Old January 21st, 2005, 12:39 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
Can u check whether the following example is useful to you or not..
----------
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
function disableExperience()
{
    if(document.fTest.Category[0].checked)
    {
        document.fTest.sExperience.selectedIndex = 0
        document.fTest.sExperience.disabled = true
    }
    else
    {
        document.fTest.sExperience.disabled = false
    }
}

</script>
<script event="onmousedown" for="fTest">
    disableExperience()
</script>
</HEAD>
<BODY>
<form name=fTest>
Category:
<input type=radio name=Category value=0 onclick="disableExperience()">Fresher</option>
<input type=radio name=Category value=1 onclick="disableExperience()">Experience</option>
<br>
<br>
Experience:
<br>
<br>
<Div id="dExperience">
<select name=sExperience>
<option value=0>Select</option>
<option value=1>1 Year</option>
<option value=2>2 Years</option>
</select>
</Div>
</form>

<P>&nbsp;</P>

</BODY>
</HTML>
--------
Thanks
Suresh






Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically generating Javascript (XSLT in IE6) einszwei XSLT 1 June 28th, 2007 01:07 PM
dynamically generating Excel file sunitapandey Struts 3 November 23rd, 2006 03:53 AM
Generating ViewState Names Dynamically rfinks VB How-To 3 July 31st, 2006 11:47 AM
Dynamically Generating Textboxes Maxood PHP How-To 6 March 9th, 2006 09:14 AM
Generating html tags dynamically sachin lad Servlets 1 April 26th, 2005 05:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.