473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

I want to be able to select multiple options for a question.

I was wondering if anyone would be able to help me figure out how to make my Q010 have the ability to chose 2 answers, I'm hoping to stay away from checkboxes but I am willing to take in any advice. If you need more information just let me know. Thanks!



Here is my .was page

Expand|Select|Wrap|Line Numbers
  1. <Page Title="AFMBS Q10">
  2.    <Load>
  3.        <Execute>
  4.     campaignOnLoad()
  5.        </Execute>
  6.    </Load>
  7. <Script src="q10.js"></Script>
  8.  
  9. <div id="questions">
  10. </div>    
  11.  
  12. <p id="response">
  13. </p>
  14.  
  15.  
  16. </Page>

Here is my .js page:

Expand|Select|Wrap|Line Numbers
  1. function pageOnLoad() //Set Page Specific Event Listeners and any functions you want called on load for this page.{
  2.     $S('CURRENTPAGE', 'q10')
  3.     questions().each(function(f) {
  4.     unDash(waParseInt(f.gsub(/Q/, '')))
  5.     create_html_for(f)
  6.      createScrollList({location: f+'Row', name: f, size: 1, values: getScale(f), program: programs(f), label: getText(f)})
  7.      eval(programs(f))
  8.       })
  9. }
  10. function questions() {
  11.      return getFields(10)
  12. }
  13. function text() {
  14.     return $H({
  15.          English: $H({
  16.     Q010: 'In the last 12 months, how often were the forms from Affinity easy to fill out?  Would you say…'
  17.                })
  18.       })
  19. }
  20. function scales() {
  21.       return $H({
  22.      English: $H({
  23.                   Q010: $H({'': '*READ LIST*',                                  A: 'Always',
  24.                       B: 'Usually',                                      C: 'Sometimes',                                  D: 'Never',
  25.                       E: 'It was not necessary for you to fill out any forms from Affinity',
  26.                       U: 'Unsure(DON\'T READ)'
  27.                                                 })
  28.          })
  29.         })
  30. }
  31.  
  32. function programs(question) {
  33.     var progs = 'mark_as_answered(\''+question+'\');'
  34.     progs += 'showCommentFor(\''+question.gsub(/[A-Z]$/, '')+'\', conditionsFor(\''+question.gsub(/[A-Z]$/, '')+'\'));'
  35.     return progs
  36. }
  37. function conditionsFor(question) {
  38.     var comments = $H({})
  39.     return comments.get(question) || ''
  40. }
  41. function onNextButton() {
  42.     if (validate()) {
  43.         $S('NEXT', 'q11')    
  44.         nextpage()
  45.     }
  46. }
  47. function validate() {
  48.     if (questions_to_validate().any(function(q) {return $G(q) == ''})) {
  49.         alert('You must answer all the questions.')
  50.         return false
  51.     }
  52.     if (questions_to_validate().any(function(question) {
  53.                                          if (conditionsFor(question).split(',').include($G(question)) && $G(question.comment()) == '') {
  54.                                          alert('You must enter a comment for ' + question + '.')
  55.                                     return true                                 }                             })) {
  56.         return false
  57.     }
  58.     return true
  59. }
Apr 7 '10 #1
1 1268
acoder
16,027 Expert Mod 8TB
What do you currently have instead of checkboxes?
Apr 29 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Simon Finn | last post by:
Hi I have used ASP code to load data into two select boxes. The code below is used to move the selected data back and forth between the boxes. I am having problems retreving the data from the...
0
by: Stephen Witter | last post by:
I have a multiple select list and I am trying to post to a page where I have no option to use the request.form or vbscript to iterate through the control. The page is a sql server reporting...
1
by: Raghuram Banda | last post by:
Hi All, Can any one please look into the following code and tell me where I went wrong <html> <head> <script language="JavaScript"> function transferItem(srcId, destId) { var destObj =...
3
by: Max Weber | last post by:
Try to run the code below in a page. You will notice than when you switch the multiple attribute of the SELECT tag, only one option is displayed as selected although multiple options have ben...
7
by: smash2004 | last post by:
i have a select field with multiple enabled so user can select multiple options... is it possible to get option that was clicked last...i need this because i need to check if this option was...
6
by: Adam Tilghman | last post by:
Hi all, I have found that IE doesn't seem to respect the <SELECT> "multiple" attribute when set using DOM methods, although the attribute/property seems to exist and is updated properly. Those...
3
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php...
7
by: ozzii | last post by:
Hi I have a HTML form with a multiple select box. The multiple select box is populated from a database. A user can select multiple options form this select box and the infomrtaion is then stored...
5
by: Max | last post by:
Is there any way to set a select-multiple type <select multiple="multiple"with multiple selected options in scripting? Any idea about this is appreciative.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.