?
Solved

Multipage DB form query with radio buttons

Posted on 2003-03-31
11
Medium Priority
?
166 Views
Last Modified: 2013-12-24
Using FP 2002 to develop a database driven questionnaire.
I can get the whole thing to work by using drop down boxes and passing hidden variables to the next form and so on, but I want the first few pages to be radio button driven.

For example :

Page1 - Is your defect...a) internal b)...external

pick internal, then shows questions based on internal

Page 2 - Is your defect... a) electrical  b)water  c)gas

thanks
0
Comment
Question by:CraigBFG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 14

Accepted Solution

by:
hhammash earned 100 total points
ID: 8239576
Hi,

<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

function DispText (val) {
frm=document.forms[0]

     if(val=="option 1")
document.MyForm.Dispq.value="This is the Internal question";

     else {
     document.MyForm.Dispq.value="This is the external question";
     }

}

</SCRIPT>

</HEAD>
<BODY TEXT="000000" BGCOLOR="FFFFFF">

<FORM name="MyForm">

<INPUT TYPE=radio NAME="f1" VALUE="option 1" onClick="DispText
(this.value)">Internal
<INPUT TYPE=radio NAME="f1" VALUE="option 2" onClick="DispText
(this.value)">External<p><input type="text" name="Dispq" size="85"></p>
<P>
&nbsp;

</FORM>
</BODY>
</HTML>

hhammash
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8239607
Hi,

In FrontPage, double click the textbox, click style, borders then put the textbox border to be with the same color of your background.

This is a textbox with white borders which make the textbox invisible,  so when you click the the option it will display the question as if there is no textbox.

<input type="text" name="Dispq" size="85" style="border: 1px solid #FFFFFF"></p>


hhammash
0
 
LVL 19

Expert Comment

by:webwoman
ID: 8240334
There's no difference between radio buttons and other fields. They pass values the same way. It's just the way they look that's different.

If you were using dropdowns, there's no reason you can't use radio buttons instead. Just use the same name as you did for the dropdowns for the group of radio buttons, and give each of them a value, the same as you did for the dropdowns.

The user will only be able to select ONE button in the group. Selecting a different button in the group will toggle the other one off. However, when they click the submit button, there's no difference between the radio button and any other form field that has a value.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 14

Expert Comment

by:hhammash
ID: 8243678
Hi CraigBFG,

I forgot to tell you that Option 1 in my code above is the value of the Radio button,  so you have to change it with your value.

You have a group name for the Radio Button and you have the value.  Put the value that you like then use it in the code.

hhammash
0
 

Author Comment

by:CraigBFG
ID: 8243903
That's ok, but the values have to come from a databasenot be hard coded into the page.

I've tried using radio button instead of a drop down box but it doesn't seem to work.

Any more ideas?
Craig
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8244073
Hi,

What will come from the database,  the questions?

Would you please put the table structure?

hhammash
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8244090
Hi,

I will work according to your table structure.  You can send the table to me to hmaf@yahoo.com with test records in it.

hhammash
0
 

Expert Comment

by:RotaredoM
ID: 8341241
Experts,

A points split was requested by CraigBFG at http://www.experts-exchange.com/Community_Support/Q_20586701.html

If no objections are made within 72 Hrs, I'l split as requested.

Thank you,

RotaredoM
CS Mod @ EE
0
 
LVL 14

Expert Comment

by:hhammash
ID: 8341402
Hi RotaredoM,

I have no objection.

hhammash
0
 

Expert Comment

by:RotaredoM
ID: 8364076
As requested, points reduced from 50 to 25.

CraigBFG,
Please finalize this question as instructed at  http://www.experts-exchange.com/Community_Support/Q_20586701.html


Thank you,

RotaredoM
CS Mod @ EE
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 8367434
Force accepted

** Mindphaser - Community Support Moderator **

webwoman, there is a separate question with points for your help in http://www.experts-exchange.com/Web/WebDevSoftware/FrontPage/Q_20591380.html
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question