Empirisoft Support

    Welcome to Empirisoft Support
Results 1 to 4 of 4

Thread: Script error for custom item using multiple variables, form (case 22425)

  1. #1
    Join Date
    Jan 2016
    Posts
    4

    Script error for custom item using multiple variables, form (case 22425)

    I need multiple fill-in-the-blank items on a single screen, so I created a multiple-variable form by following the instructions in "Sample 5: custom items - multiple variables."

    I made only minor changes to the html provided on this Empirisoft page when making my own, but I'm getting the following script error when I run it: "object doesn't support property or method focus"

    Here is my html:

    Code:
    <!-- saved from url=(0013)about:internet -->
    <style><ml.styles></style>
    <body onload="document.form.name.focus();"> 
    <form name="form" method="post"><br>Think about your next exam. How do you plan to study for it? Assign each strategy a percentage (the total should equal 100%).<br>
       <ml.wording><br><br>
    <table>
        <tr><td> Reviewing the textbook or other readings </td><td> <input name="<ml.totals>_01"></td></tr>
        <tr><td> Re-reading your own notes </td><td> <input name="<ml.totals>_02"></td></tr>
        <tr><td> Discussing the material with other students or a tutor </td><td> <input name="<ml.totals>_03"></td></tr>
        <tr><td> Making flashcards and quizzing yourself with them </td><td> <input name="<ml.totals>_04"></td></tr>
        <tr><td> Quizzing yourself on material in a way other than using flashcards </td><td> <input name="<ml.totals>_05"></td></tr>
        <tr><td> Re-writing your notes </td><td> <input name="<ml.totals>_06"></td></tr>
        <tr><td> <br><input type="submit" value="Continue"></td></tr>
    </table>
    </form>
    </body>
    Thanks in advance!
    Last edited by jason_reed; 02-02-2016 at 12:04 PM.

  2. #2
    Join Date
    Feb 2013
    Posts
    1,093
    Please upload the .htm and .que files that you are using to run this code in MediaLab.

    What version of Internet Explorer and MediaLab do you have? You can find the version of MediaLab (v.20xx.x.xxx) by opening the MediaLab.exe file and looking in the upper left corner of the main program window.
    Jason Reed
    Empirisoft Software Support Specialist

  3. #3
    Join Date
    Jan 2016
    Posts
    4
    Quote Originally Posted by jason_reed View Post
    Please upload the .htm and .que files that you are using to run this code in MediaLab.

    What version of Internet Explorer and MediaLab do you have? You can find the version of MediaLab (v.20xx.x.xxx) by opening the MediaLab.exe file and looking in the upper left corner of the main program window.
    I was using version 2012, but I actually gave up on creating a form and had participants complete a paper survey for this particular task instead. (So I no longer need assistance.) Thanks for the help, though.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,093
    I'm glad to hear that you found a workaround.

    After playing with your html code, it appears that the script error was related to this line of code:

    <body onload="document.form.name.focus();">

    I created a Custom item (see attached files) without that line in it and based on the same Sample code you used. I also changed the <ml.totals> to <ml.varname> to get the responses in the boxes to record in the MediaLab data file. Where did you get the use of <ml.totals>?

    It ran on MediaLab 2014 without the script error box and successfully recording the data. Feel free to take a look. After downloading the .txt file, make sure to change the file format to .htm to use it with the .que file.
    Attached Files Attached Files

Similar Threads

  1. Replies: 1
    Last Post: 11-14-2015, 10:42 AM
  2. Custom item not recognizing ml. variables
    By xihao_he in forum MediaLab Older Versions: Troubleshooting
    Replies: 0
    Last Post: 11-13-2009, 01:42 PM
  3. Custom item with various html form elements
    By huiyun in forum MediaLab Older Versions: Troubleshooting
    Replies: 1
    Last Post: 11-05-2009, 10:59 PM
  4. Custom item issue with multiple radio
    By maxweis in forum MediaLab Older Versions: Sharing Area
    Replies: 1
    Last Post: 06-17-2008, 04:58 PM
  5. Repeating a custom item that has multiple questions?
    By jarvis24 in forum MediaLab Older Versions: How Do I...
    Replies: 5
    Last Post: 01-16-2007, 10:25 AM

Tags for this Thread

Posting Permissions

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