-
Add line to page based upon selection from drop-down box
I'm trying to work on a page that will add a new table row to an existing
table based upon a selection from a drop down box. The box will have 3 selections;
Select, Single-User, Multi-User. Only if the user selects Multi-User should
the new table row display.
Any ideas on how I can do this?
Thanks,
Dean
-
Re: Add line to page based upon selection from drop-down box
Dean,
Assign a class to the TR and use styles to hide the TR. Example style tag,
tr.dynamic {
display:none;
}
Then create a function called say, showRow().
Then use the onchange() or onclick() event handler to set off the function
to changes the styles display value from none to block or inline.
Just assign an ID to the row and use the getElementById property of the document
object to reference the row to dynamically display.
I could be more detailed if I knew what was to appear in that new table row
but I hope this helps.
Good luck and let me know if you have any questions,
Michael
"Dean" <satchmo82@hotmail.com> wrote:
>
>I'm trying to work on a page that will add a new table row to an existing
>table based upon a selection from a drop down box. The box will have 3
selections;
>Select, Single-User, Multi-User. Only if the user selects Multi-User should
>the new table row display.
>
>Any ideas on how I can do this?
>
>Thanks,
>
>Dean
-
Re: Add line to page based upon selection from drop-down box
Hi Dean,
I can think of two ways of doing this,
1) You can always have the "new" row and keep it hidden till the user selects
"Multi User". and hide it for other options
2) Add the row as the user selects the "Multi User option"--
// Inserts a row into the table
tblName.insertRow();
// Inserts individual cells for each row
for(iColCount=0; iColCount<=iCols;iColCount++){
tblName.rows[tblName.rows.length-1].insertCell(iColCount);
}
Hope this helps.
"Dean" <satchmo82@hotmail.com> wrote:
>
>I'm trying to work on a page that will add a new table row to an existing
>table based upon a selection from a drop down box. The box will have 3
selections;
>Select, Single-User, Multi-User. Only if the user selects Multi-User should
>the new table row display.
>
>Any ideas on how I can do this?
>
>Thanks,
>
>Dean
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks