#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Memphis
    Posts
    1
    Rep Power
    0

    Exclamation Passing values: 95% completed - help!


    How can I get the passed values to be unique?
    Rules of this script via the user:
    Have 4 sections
    Each section has 8 questions
    Only 2 out of the 8 questions can be selected in each section

    Pass the selected questions (checkboxes) to a page where their values (hyperlinks) will be displayed.
    This code is 95% completed, but I can figure out the rest of this riddle. Any help will be greatly appreciated!!!!


    <HTML>
    <HEAD>
    <TITLE> Selected Interview Links </TITLE>
    </HEAD>

    <Script Language="JavaScript">
    <!--
    function Form1_Validator(theForm) {
    var needsattn = "";

    // CATEGORY 1 - IS THE ORAL PORTION../reader. NOT ON THIS PAGE
    // must be 2 and only 2 selections per category!
    // CATEGORY 2

    var checkSelected = false;
    var checkCounter = 0;

    for (i = 0; i < theForm.checkbox2.length; i++) {
    if (theForm.checkbox2[i].checked)
    checkCounter = checkCounter + 1; }
    // if (checkCounter > 2)
    if (checkCounter != 2) {

    needsattn += "\n - PLANNING, ORGANIZING, AND SCHEDULING \n"; }

    // CATEGORY 3

    var checkSelected = false;
    var checkCounter = 0;

    for (i = 0; i < theForm.checkbox3.length; i++) {
    if (theForm.checkbox3[i].checked)
    checkCounter = checkCounter + 1; }
    // if (checkCounter > 2)
    if (checkCounter != 2) {

    needsattn += "\n - WORK ORIENTATION \n"; }

    // CATEGORY 4

    var checkSelected = false;
    var checkCounter = 0;

    for (i = 0; i < theForm.checkbox4.length; i++) {
    if (theForm.checkbox4[i].checked)
    checkCounter = checkCounter + 1; }
    // if (checkCounter > 2)
    if (checkCounter != 2) {

    needsattn += "\n - EMPLOYEE SUPERVISION \n"; }

    // CATEGORY 5

    var checkSelected = false;
    var checkCounter = 0;

    for (i = 0; i < theForm.checkbox5.length; i++) {
    if (theForm.checkbox5[i].checked)
    checkCounter = checkCounter + 1; }
    // if (checkCounter > 2)
    if (checkCounter != 2) {

    needsattn += "\n - WORKING EFFECTIVELY WITH OTHERS \n"; }

    if (needsattn != "") {
    needsattn ="You must select 2 and only 2 questions from each\n" +
    "of the interview categories. You have selected\n" +
    "an incorrect number of questions for the following\n" +
    "categories: \n\n" +
    needsattn + "\n\n" +
    "Click OK to return to the question selection page.\n";
    alert(needsattn);
    return false; }
    else return true;
    }

    // new stuff

    function selQuest()
    {
    for (i=0;i<3;i++)
    {
    cc=theForm.checkbox2[i].length;
    if (cc) ahref2=cc.value;

    cc=theForm.checkbox3[i].length;
    if (cc) ahref3=cc.value;

    cc=theForm.checkbox4[i].length;
    if (cc) ahref4=cc.value;

    cc=theForm.checkbox5[i].length;
    if (cc) ahref5=cc.value;
    }

    HTMLstring='<HTML>\n';
    HTMLstring+='<HEAD>\n';
    HTMLstring+='<TITLE>Selected Interview Links</TITLE>\n';
    HTMLstring+='</HEAD>\n';
    HTMLstring+='<BODY bgcolor=#FFFFFF>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref2+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref2+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref3+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref3+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref4+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref4+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref5+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='<A HREF="'+ahref5+'">Selected Interview Question</A>\n';
    HTMLstring+='<P>\n';
    HTMLstring+='</BODY>\n';
    HTMLstring+='</HTML>';
    alert(HTMLstring);
    newwindow=window.open();
    newdocument=newwindow.document;
    newdocument.write(HTMLstring);
    newdocument.close();
    }
    // -->
    </Script>

    <BODY>

    <script src="http://hrweb.corp.fedex.com/cgi-bin/insert/inserter.cgi?Examples/NewsExample.txt"></script>

    <FORM method="post" name="theForm" onSubmit="return Form1_Validator(this) && selQuest();">

    <input type="checkbox" name="checkbox2" value="../reader/2A.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2B.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2C.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2D.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2E.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2F.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2G.pdf">
    <input type="checkbox" name="checkbox2" value="../reader/2H.pdf">

    <P>

    <input type="checkbox" name="checkbox3" value="../reader/3A.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3B.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3C.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3D.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3E.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3F.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3G.pdf">
    <input type="checkbox" name="checkbox3" value="../reader/3H.pdf">

    <P>

    <input type="checkbox" name="checkbox4" value="../reader/4A.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4B.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4C.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4D.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4E.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4F.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4G.pdf">
    <input type="checkbox" name="checkbox4" value="../reader/4H.pdf">

    <P>

    <input type="checkbox" name="checkbox5" value="../reader/5A.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5B.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5C.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5D.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5E.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5F.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5G.pdf">
    <input type="checkbox" name="checkbox5" value="../reader/5H.pdf">

    <P>

    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">

    </Form>






    </BODY>
    </HTML>
    Attached Files
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    You want the javascript/html forum

IMN logo majestic logo threadwatch logo seochat tools logo