www.webdeveloper.com
Results 1 to 3 of 3

Thread: Help with Form Dependency Manager

  1. #1
    Join Date
    May 2007
    Posts
    37

    Help with Form Dependency

    I'm trying to use Form Dependency. If I put the dependent items in a single column table as follows, it works fine:

    <head>
    <script src="FormManager.js"></script>
    <script type="text/javascript">
    window.onload = function() {
    setupDependencies('AskUs', 'AskUs1', 'weboptions'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
    };
    </script>
    </head>
    <body>
    <form name="AskUs1" method="post" action="http://ohiobuttons.org/test/Process_Questions.php" onsubmit="return checkrequired(this);">
    <table><tr><td>
    <label>Phone ( <input type="text" class="DEPENDS ON Contact BEING EMPTY OR Contact BEING Email" name="Areacode" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> )
    <input type="text" class="DEPENDS ON Contact BEING EMPTY OR Contact BEING Email" name="Prefix" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> -
    <input type="text" class="DEPENDS ON Contact BEING EMPTY OR Contact BEING Email" name="Phonenumber" onkeyup="return autoTab(this, 4, event);" size="4" maxlength="4" onblur="checkit(this)"></label>
    <input type="hidden" class="DEPENDS ON Contact BEING phone OR Contact BEING Email">
    <label>Phone*( <input type="text" id=Required class=="DEPENDS ON Contact BEING Phone" name="Areacode" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> )
    <input type="text" id=Required class="DEPENDS ON Contact BEING Phone" name="Prefix" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> -
    <input type="text" id=Required class="DEPENDS ON Contact BEING Phone" name="Phonenumber" onkeyup="return autoTab(this, 4, event);" size="4" maxlength="4" onblur="checkit(this)"></label>
    </td></tr>
    <tr><td>
    <label>Email <input type="text" class="DEPENDS ON Contact BEING EMPTY OR Contact BEING Phone" name="Email" size="32" maxlength="40" onblur="checkit(this)"></label>
    <label>Email* <input type="text" id=Required class="DEPENDS ON Contact BEING Email" name="Email" size="32" maxlength="40" onblur="checkit(this)"></label>
    </td</tr>
    <tr><td>
    How do you wish to be Contacted <select name="Contact">
    <option value=""><option value="Phone">Phone<option value="Email">Email</select>
    </td></tr></table>
    </form>

    But if I try to put it in a 2 column table such as:

    <head>
    <script src="FormManager.js"></script>
    <script type="text/javascript">
    /****************************************************
    * Form Dependency Manager- By Twey- http://www.twey.co.uk
    * Visit Dynamic Drive for this script and more: http://www.dynamicdrive.com
    ****************************************************/
    window.onload = function() {
    setupDependencies('AskUs', 'AskUs1', 'weboptions'); //name of form(s). Seperate each with a comma (ie: 'weboptions', 'myotherform' )
    };
    </script>
    </head>
    <body>
    <table>
    <tr>
    <td align="right">Phone </td><td align="left">( <input type="text" name="Areacode" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> )
    <input type="text" name="Prefix" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> -
    <input type="text" name="Phonenumber" onkeyup="return autoTab(this, 4, event);" size="4" maxlength="4" onblur="checkit(this)"></td>
    </tr>
    <tr>
    <td align="right">Email </td><td align="left"><input type="text" name="Email" size="32" maxlength="40" onblur="checkit(this)"></td>
    </tr>
    <tr>
    <td align="center" colspan=2>
    How do you wish to be Contacted <select name="Contact">
    <option value=""><option value="Phone">Phone<option value="Email">Email</select>
    </td></tr></table>

    it doesn't work. I suspect it has to do with the placement of the Class= parameters. Can someone please help me with this?

    Thanks.
    ps. I apologize for the cruddy formating. It looks good in my editor, but messy when I cut and past it.
    Last edited by jimweinberg; 03-04-2012 at 06:02 PM.

  2. #2
    Join Date
    Mar 2012
    Posts
    7
    Code:
    <input type="text" id=Required class="DEPENDS ON Contact BEING Phone" name="Prefix" onkeyup="return autoTab(this, 3, event);" size="3" maxlength="3" onblur="checkit(this)"> -
    <input type="text" id=Required class="DEPENDS ON Contact BEING Phone" name="Phonenumber" onkeyup="return autoTab(this, 4, event);" size="4" maxlength="4" onblur="checkit(this)">
    You have no quots on your id value

    id=Required <---- Yours
    id="Required" <---- Right !

  3. #3
    Join Date
    May 2007
    Posts
    37
    CeJay.

    I appreciate the comment, but that doesn't seem to be part of my problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles