close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Radio button problems and code errors

Thread began 11/22/2010 1:51 pm by mrs | Last modified 3/17/2011 6:52 am by mrs | 3073 views | 11 replies

Russell CollinsBeta Tester

Hi mrs,

As Jason indicated, radio buttons are more like a number selector function.
1 would = yes
0 would = no
So if a buttons checked value was 1 it would mean yes
And if the second buttons checked value was 0 would mean no.

You can of course have as many buttons as you like to express other meaning such as colour
button1 checked value 1 = red
button2 checked value 2 = blue
button3 checked value 3 = yellow and so on.

This is why when you run the wizard you get only 2 radio buttons.
The wizard stitches the "functionality" of the buttons between the pages,
but it is up to you to add what sort of checked values you want and, how many.

So in the example above

step 1 would be to ensure your database set up correctly for this type of use.

Lets look at the most basic db.
Table name = yes_no
field1 IDyesno, INT(11), auto inc, pk
field2 decision, tinyint(1) - this data will be either 1 or 0 ( equating to yes or no)
field3 description, VARCHAR(64) - a persons name for example if your doing a survey

Step 2
on the search page
Select the button you labeled yes and put 1 as the checked value (by default it adds the word radio)

Step 3
on the search page
Select the button you labeled no and put 0 as the checked value (again it will have the word radio in it)

Your search functions will now work with field 2 of the database

Step 4
on the insert page
Repeat the same as in step 2 & 3

Step 5
on the update page
Select the yes button
remove the code that was placed in the "checked value" in the properties tab and replace it with the number 1

Step 6
Select the "bind to dynamic source" button on the properties tab and set the value to the field2 "decision" in the recordset from the above db

step 7
on the update page
select the no button
remove the code that was placed in the "checked value" in the properties tab and replace it with the number 0

Step 8
on the update page
Select the "bind to dynamic source" button on the properties tab and set the value to the field2 "decision" in the recordset from the above db

This will give you all the functionality of insert, update, search etc on the subject of yes/no
One point to take into consideration is that on the search results it will show 1 or 0 in the dynamic text of field2 column, the same will also apply to the details page.
If you wanted to have the name yes or no you could do an inner join from a 2 row db.
for example
table name = decision
field1 ID INT(11)
field2 Decision VARCHAR(10)
0===No
1===Yes

You could however just use a static menu to get the same results into a db as text.

Regards

Russ

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...