SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    retaining state for checkboxes and radio buttons

    i have a series of checkboxes and radio buttons. when the user submits the information it goes to another page, where it is validated. however, if there is a mistake in the data, a hyperlink brings the user back to the original page. however, the checkboxes and radio buttons are back to their default state - how do i fix this? (i have used the session variable for the text boxes). here is an example of the checkboxes and radio buttons:
    4. How would you describe your role within the organisation?
    <BR>
    DecisionMaker
    <INPUT TYPE=CHECKBOX NAME=Role >
    <BR>
    Buyer
    <INPUT TYPE=CHECKBOX NAME=Role2 >
    <BR>
    Advisor<INPUT TYPE=CHECKBOX NAME=Role3 >
    <BR>
    User
    <INPUT TYPE=CHECKBOX NAME=Role4 >
    <BR>
    Implementer
    <INPUT TYPE=CHECKBOX NAME=Role5 >
    <BR>

    Please indicate your organisation’s primary business category:
    <BR>
    Consultants/SoftwareHouse
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R1">
    <BR>

    Government Agency
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R2">
    <BR>

    Construction/Manufacturing/Distribution
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R3">
    <BR>

    Wholesale/Retail Trade
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R4">
    <BR>

    Finance/Insurance/Real Estate
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R5">
    <BR>

    Service/Communications
    <INPUT TYPE=RADIO NAME=Category VALUE="Q1R6">
    <BR>

  2. #2
    (****** or Deleted)
    Join Date
    May 2002
    Location
    Melbourne, Australia
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You say that you use a hyperlink to direct the user back to the form? If so, this should be as easy as replaciong the link with javascript, as when you hit "back" on a web browser it remembers the information that was stored...

    Instead of:
    Code:
    <a href="formpage.html">Back</a>
    Try:

    Code:
    <a href="javascript:void(null)" onClick="history.back()>Back</a>
    That should work fine

  3. #3
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    retaining state

    Thank you for your help!
    i am actually coding in VBScript - would it be possible to do a similar function through VBScript instead of Javascript?

  4. #4
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This isn't server-side. What's happening is the Javascript is accessing the client browser's history to go back one page.

    Why not just use Javascript? You can still use VBScript on the server if that's what you're doing. And unlike client-side VBScript, Javascript is also supported by Netscape.
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •