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
    Mar 2009
    Posts
    401
    A suggestion I could make would be to look into implementing a bit of javascript into your custom item so that the fields can be properly validated before the user is allowed to continue. You may want to use google to find more information. Unfortunately, we don't currently have a sample showing how this can be done; however there seems to be a few other posts where users have noted a similar request.

    The following may give a bit more insight into a solution:
    www.empirisoft.com/Support/showthread.php?t=1314
    www.empirisoft.com/Support/showthread.php?t=1330
    www.empirisoft.com/support/showthread.php?t=222
    Last edited by jarvis24; 03-24-2010 at 05:36 AM.

  2. #2
    Join Date
    Mar 2009
    Posts
    401

    Sample Requiring Responses

    [edited from followup support email]

    I have a validation script for the radio buttons working now. The only issue I find with it is that it displays an alert for each item <note from moderator: see fix below>, which would be fine if the prompts were item specific but that isn't the case. Nonetheless, we don't anticipate people skipping the entire questionnaire, so it isn't an issue and it is working as designed.

    Attached you can find our sample files for future reference and use.

    <attachment revised and reposted, see below>
    Last edited by jarvis24; 03-24-2010 at 05:48 AM.

  3. #3

    form validation

    I downloaded the script you attached here and couldn't get it to work. In fact when I tried to run through your questionnaire, I got the "This website cannot be loaded" error message.

    Does this questionnaire work for you still?

    I have a workable knowledge of HTML, but am a Javascript idiot. Is it possible for you to post some directions on where variable names are, and what filename (?) should be used for the form name.

    Any help with this would be much appreciated.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,328
    Don--I've attached a revision of the previous attachment that simplifies it and takes care of the repeat feedback if more than one item is no answered. The sample que file that accompanies it also contains just this item flanked by simple instruction items so that there should be no file location issues that arise when testing it. I've also added a few comment lines that explain some of complicated looking stuff. Please let me know if it helps!
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2005
    Posts
    3,328

    Require at least one response but not necessarily all

    Note in response to the orginal post (see above), one could change the syntax in this custom item to require that just one or more questions be answered (as opposed to all). I didn't test it, but you should be able to simply replace all the instances of "||" (meaning or) with "&&" (meaning and). This would then generate the feedback message only if no questions were answered.
    Last edited by jarvis24; 03-24-2010 at 05:49 AM.

  6. #6
    Thanks for the clarifications. So I entered in this code throughout a number of different HTML questionnaire files. It works properely in 2, however in most of them I get the following error message:

    An error has occurred in the script on this page.
    Line: 8
    Char: 5
    Error: 'documnt.Q1norms.nr1.7.checked' is null or not an object
    Code: 0
    URL: file:///C:/MediaLab/Samples/Reciproc...%20%20%20.html

    Do you want to continue running scripts on this page?

    I get the above message whether the questions have been answered or not.

    When I run the questionnaire I'm attaching, the Q1norms gives me the error messages while the demos works properely. They are both used by the questionnaire I'm attaching.
    Attached Files Attached Files

  7. #7
    Please verify that my response with attached files was received. I don't see it here on the board yet and wanted to make sure it got sent/attached.

  8. #8
    Join Date
    Nov 2005
    Posts
    3,328
    Most posts with URLs in them are spam so we have them go through a moderation queue before being approved. Will take a look at your files now and see if I can tell what's going on. <minutes pass>

    I just ran it and did not see the error. What do you have to do exactly to see this error message?
    Last edited by jarvis24; 03-25-2010 at 03:51 PM.

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
  •