Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Passing radio button status to a form
Old 09-04-2007, 12:36 PM Passing radio button status to a form
Skilled Talker

Posts: 81
Trades: 0
Hi

I have a questionnaire which is a mixture of checkboxes and radio buttons. Mainly checkboxes. When selected, each checkbox or radio button also adds a certain score to a running total, using javascript.

Then, the user can press a button to see a report form which will echo back comments relating to what select boxes or radio buttons they chose.

To make each checkbox/radio button pass its status to the report form, it needs a unique identifier. And this has to be name="uniquename". (id="uniquename" doesn't work)

To make the javascript work, each checkbox (and each set of radio buttons) needs a name that is the same. Although the script will pick up on either id or name, id has already been 'used up' - see previous para.

For the select boxes, this is no problem. But if I give the radio buttons different names as unique identifiers, of course this means that people can select more than one radio button. If I give them the same name, so as to work properly as radio buttons, and make the unique identifier as id="uniquename", then the status of the radio button is not passed to the form.

The report form picks up the status of a checkbox called 'appearance' thus:

PHP Code:
<?php
if (array_key_exists('appearance',$_POST)) { 
echo 
"some text";
}
else { echo 
"some different text"; }
?>
Any ideas how to get out this dilemma? I suppose I could dispense with radio buttons and use some sort of javascript to mimic radio button behaviour within a set of two or three checkboxes. But I'm hoping for something easier, and which will work even if js is disabled.

thanks for any wisdom

tony
soon is offline
Reply With Quote
View Public Profile Visit soon's homepage!
 
 
Register now for full access!
Reply     « Reply to Passing radio button status to a form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.94755 seconds with 12 queries