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 June 9th, 2003, 12:59 AM
Registered User
 
Join Date: Jun 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help me about Collection' Count Property!

Hello all!
I have a problem about display data by using a collection's count property, please help me.
At the moment, i am coding test online (example physics, math...).At page 96 of book "Professional ActiveX Server Page 2.0", How did i can display va count radio button what NO CHECK.
Thank you very much.


Example:
Page1.asp

<form NAME="userinfo" ACTION="QUESTVB.ASP" METHOD="POST">
   <h2>Please enter your details here</h2><p>
   <pre>
    How many computers in your organization

    <input TYPE="RADIO" NAME="numComps" VALUE="0-9">0-9
    <input TYPE="RADIO" NAME="numComps" VALUE="10-49">10-49
    <input TYPE="RADIO" NAME="numComps" VALUE="50-99">50-99
    <input TYPE="RADIO" NAME="numComps" VALUE="Unknown">Don't know

    How often do you buy software

    <input TYPE="RADIO" NAME="soft" VALUE="2">Every second month
    <input TYPE="RADIO" NAME="soft" VALUE="6">Once in half a year
    <input TYPE="RADIO" NAME="soft" VALUE="12">Once a year
    <input TYPE="RADIO" NAME="soft" VALUE="Never">Never
   </pre>
    <p>
    <input TYPE="RESET" VALUE="Clear">
    <input TYPE="SUBMIT" VALUE="Send">
   </center>
  </form>

Page1.asp:

<%
  For Each Item in Request.Form
   If Request.Form(Item).Count Then
    For intLoop = 1 to Request.Form(Item).Count
%>

<% Response.Write(Item & ": Index = " & intLoop & " Value = " _
            & Request.Form(Item)(intLoop)) %> <BR>
<%
   Next
   Else
%>

<% = Request.Form(Item) %>

<%
   End If
   Next
%>

When radio button no Check thi write NO CHECK.
 
Old June 11th, 2003, 10:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If no radio button is checked, then *no* information about the radio buttons is sent by the browser to the server. The Server-side ASP code knows nothing about your form, so it knows nothing about the radio buttons. All it knows is what the browser sent to the server - and the browser didn't send anything about the radio buttons.

You could create a hidden input field on your form. Then, when the form is submitted, you use some client-side javascript to check whether any radio buttons were checked. And if no value is checked, you set the value of the hidden input element to reflect this fact.

Cheers
Ken

www.adOpenStatic.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL: Count = Count + 1 elayaraja.s XSLT 3 July 18th, 2008 03:21 AM
Can you Assign a Collection to a Property? MandMD2 Beginning VB 6 2 May 3rd, 2007 05:24 PM
is there any in built function to count page count g.tamilselvan MySQL 1 February 15th, 2006 07:43 AM
Count, sum, count a value, return records CongoGrey Access 1 April 18th, 2005 02:25 PM
COM Collection ben0027 Visual C++ 0 May 1st, 2004 05:19 AM





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