Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 12 of 12

Thread: Validating Custom Item Required Responses

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2005
    Posts
    3,328
    On second look, I noticed it seems to be the 7th option it doesn't like in every case. Coincidentally you have 7 options for each item (in your Q1norms.html file). I am not a java pro, but I believe one difference between your file and the one posted before it, is that the array indices start at [0] in the earlier sample, whereas you have your indices starting at [1]. If Java likes the indices to start at 0, then maybe try referencing them as 0-6 rather than as 1-7. Also, you might try adding the first few lines of code from the previously posted sample--it will get rid of the annoying IE security message while testing your item in IE, and will also allow the MediaLab fonts and colors to be applied. i.e., as the first lines of the HTML file:
    <!-- saved from url=(0013)about:internet -->
    <!-- previous line supresses security control from IE-->
    <style><ml.styles></style>
    <!-- previous line requests that this page uses current colours and fonts from MediaLab-->
    Last edited by jarvis24; 03-25-2010 at 04:03 PM.

  2. #2
    Thanks for taking a look at this. In general I must say I don't like using the ml.styles code with HTML questionnaires. The fonts are so large it makes it "impossible" to preview the formatting of the questions... but that's rather unimportant.

    I don't have time to verify that you've fixed my problem, however I went into the code and changed the first variable to range from 0-6 instead of 1-7 as you suggested. When I ran it again and clicked submit without clicking on any radio buttons I got the proper "please answer all questions" popup that is supposed to happen.

    Then I ran through the same questionnaire again and answered the first question (the one now changed to 0-6 values) and clicked submit without answering the other questions. Now the error message was the same as I posted before but it referenced the second variable - which is still valued at 1-7.

    Hopefully you've solved my problem, however I must say that I find it odd that this is the cure. I guess I'll just have to recode everything later so that all my zeros are 1's for analysis purposes.

    I'll post again tomorrow once I have a chance to verify that this truely is the fix.

    Whats up with Java and 7's?

  3. #3
    So I believe you've solved my problems. The interesting part that doesn't exactly make sense to me is that the HTML code specifying the values for each response are now numbered 1-7 (as I would want them to be), however in the Javascript statement, I had to renumber everything so that it's 0-6. I guess the Java just accesses the results starting with item 0 no matter what the value you assign it is. For this reason, when I had it looking for item 7, there was no item there because that would actually be the 8th item the Java looks at.

    I'm attaching the revised versions of the above attachments for anyone else who wants to write some validation code.
    Attached Files Attached Files

Similar Threads

  1. help creating a custom item
    By psychfan in forum MediaLab Older Versions: General Questions
    Replies: 2
    Last Post: 04-02-2010, 04:53 AM
  2. Custom item - Autosum
    By akipaki_sf5 in forum MediaLab Older Versions: Sharing Area
    Replies: 16
    Last Post: 12-06-2008, 02:31 PM
  3. Submit custom item values to responses.xls
    By Thomas in forum MediaLab Older Versions: How Do I...
    Replies: 5
    Last Post: 10-16-2008, 02:01 PM
  4. Two Custom Item Issues
    By jasonp220 in forum MediaLab Older Versions: Troubleshooting
    Replies: 4
    Last Post: 10-07-2008, 03:32 PM
  5. Validating response with custom item
    By wagnerla in forum MediaLab Older Versions: How Do I...
    Replies: 1
    Last Post: 09-02-2008, 10:59 AM

Posting Permissions

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