Hidden Form Objects and asp

D

David

Hi,

I have an addition I would like to make to an asp web form I have.

On the form, I have a field which the user inputs a 'quantity' of
guests.
If this field is greater than 0 (zero) (How do I test for this ...
onLostFocus ??), I have a row of fields required for each guest.

i.e

First Name | Last Name | Age | Room Type | ....... etc

The fields are the same for each guest, but just named differently.

Guest qty = 3

Then 3 rows of fields should display, or if they are halfway through
filling them in and wish to add/remove a row of fields, there needs to
be an option for that also, Delete / Add Guest button ?

If this can be done, how are the fields named, as the form info needs
to be sent via email.
With my asp pages, I am using Request.form("Text_Field_Name"), but
should they be dynamic names ??

Or are for example, 10 rows created and all fields named separately,
but only the specified number are set to display,
i.e. 3 are shown to the user and 7 are hidden ?

I would appreciate any help/advice you can offer

Thanks

David
 
T

Thomas 'PointedEars' Lahn

David said:
I have an addition I would like to make to an asp web form I have.

On the form, I have a field which the user inputs a 'quantity' of
guests.
If this field is greater than 0 (zero) (How do I test for this ...
onLostFocus ??), I have a row of fields required for each guest.

i.e

First Name | Last Name | Age | Room Type | ....... etc

The fields are the same for each guest, but just named differently.

Guest qty = 3

That is neither JScript nor JScript .NET. Probably it is C#.
[...]
I would appreciate any help/advice you can offer

Try the newsgroups

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.languages.csharp

instead.


PointedEars
 
D

David

This is JavaScript !

I need to know how to take a number value entered into my form text
box (lost focus), which then displays from 1 to 15 rows of identical
fields, which have already been set up in the form within DIV
containers.
When any rows are displayed, I need a text or button option to Remove
or Add Guest (basically, to clear the current guest if to hide,
otherwise to leave as is and reveal another row guest


David

-------------------------------------------------------------------------------



David said:
I have an addition I would like to make to an asp web form I have.
On the form, I have a field which the user inputs a 'quantity' of
guests.
If this field is greater than 0 (zero) (How do I test for this ...
onLostFocus ??), I have a row of fields required for each guest.

First Name | Last Name | Age | Room Type | ....... etc
The fields are the same for each guest, but just named differently.
Guest qty = 3

That is neither JScript nor JScript .NET. Probably it is C#.
[...]
I would appreciate any help/advice you can offer

Try the newsgroups

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.languages.csharp

instead.

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
 
T

Thomas 'PointedEars' Lahn

David top-posted:

http://www.jibbering.com/faq/faq_notes/clj_posts.html

[Quotation repaired:]
David said:
I have an addition I would like to make to an asp web form I have.
On the form, I have a field which the user inputs a 'quantity' of
guests.
If this field is greater than 0 (zero) (How do I test for this ...
onLostFocus ??), I have a row of fields required for each guest.
i.e
First Name | Last Name | Age | Room Type | ....... etc
The fields are the same for each guest, but just named differently.
Guest qty = 3
That is neither JScript nor JScript .NET. Probably it is C#.
[...]
I would appreciate any help/advice you can offer
Try the newsgroups

microsoft.public.dotnet.framework.aspnet
microsoft.public.dotnet.languages.csharp

This is JavaScript !

That's unlikely with ASP(.NET). It may be client-side JScript,
though. Still, posting to the ASP.NET group or any of
microsoft.public.inetserver.asp.* is probably not a bad idea.
I need to know how to take a number value entered into my form text
box (lost focus), which then displays from 1 to 15 rows of identical
fields, which have already been set up in the form within DIV
containers.

function handleChange(o)
{
for (var i = 0, len = +o.value; i < len; i++)
{
divs.style.display = "block";
}
}

<input ... onchange="handleChange(this)">

The usual feature tests should be applied.
When any rows are displayed, I need a text or button option to Remove
or Add Guest (basically, to clear the current guest if to hide,
otherwise to leave as is and reveal another row guest

<div id="...">
...
<input type="button" value="Remove Guest" onclick="removeGuest(this)">
<input type="button" value="Add Guest" onclick="addGuest(this)">
</div>


http://www.w3.org/DOM/
http://developer.mozilla.org/en/docs/DOM
http://msdn2.microsoft.com/en-us/library/ms533050.aspx

Watch for graceful degradation.


HTH

PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top