Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Hidden Form Objects and asp

Reply
Thread Tools

Hidden Form Objects and asp

 
 
David
Guest
Posts: n/a
 
      09-18-2007
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

 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      09-18-2007
David wrote:
> 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
--
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
 
Reply With Quote
 
 
 
 
David
Guest
Posts: n/a
 
      09-18-2007
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

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



On 18 Sep, 11:09, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
wrote:
> David wrote:
> > 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
> --
> 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







 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      09-18-2007
David top-posted:

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

[Quotation repaired:]

> On 18 Sep, 11:09, Thomas 'PointedEars' Lahn <(E-Mail Removed)>
> wrote:
>> David wrote:
>>> 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[i].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
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$(E-Mail Removed)>
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Hidden field on post back and retrieve value from Hidden Field Rick ASP .Net 3 04-13-2010 05:38 PM
Win 7 folders hidden despite 'show hidden' checked Boppy NZ Computing 10 01-23-2010 02:56 AM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
How would I discover the text in a block element hidden by overflow:hidden style being set? SolarCanine Javascript 2 09-20-2005 06:27 PM
Accessing hidden objects in a form Craig Anderson Javascript 5 07-13-2004 03:08 PM



Advertisments