Solved

Radio buttons won't work on first click to execute funtion

Posted on 2004-09-21
7
326 Views
Last Modified: 2008-01-09
I have two forms in acrobat. In the first form there are 3 radio buttons that have javascript actions behind them. They do a series of actions but the first one is a  highlight funtion to bold and change the font of the texbox next to the radio button that is checked.  It works fine with the form that has 3 radio buttons, but i have another form which has only 2 radio buttons. This form doesn't bold and change the font size on the first click, you are forced to click down on it multiple times before you get the result . Where i only have to click once on the form that has the 3 radio buttons. Here is the code:

FORM 2 with 2 buttons does not work
----- start

//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------

//<Document-Level>
//<ACRO_source>highlight</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:highlight ***********/
function highlight(f,selected)
{
// set some default style parameters
   
    f.richText = true; // this field does contain rich text
    f.multiline = true; // multiline

    var currentText = f.value;

    var spans = new Array();

    spans[0] = new Object();
    spans[0].text = currentText;

    if (selected)
    {
        spans[0].fontWeight = 700;
        spans[0].textSize = 16;      
    }
    else
    {
        spans[0].fontWeight = 400;
        spans[0].textSize = 14;
    }
   
    f.richValue = spans;
}
//</ACRO_script>
//</Document-Level>

//<Document-Level>
//<ACRO_source>highlightTextField();</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:highlightTextField(); ***********/
function highlightTextField()
{
    // get the current setting of the radio button
    var selected = this.getField("Radio Button1").value;

    highlight(this.getField("norecord"), selected==0);
    highlight(this.getField("record"), selected==1);
}
//</ACRO_script>
//</Document-Level>

//<AcroForm>
//<ACRO_source>Button17:Annot1:MouseUp:Action2</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Button17:Annot1:MouseUp:Action2 ***********/
var fucker = this.getField("date");
fucker.value = "";

//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>Radio Button1:Annot1:MouseDown:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Radio Button1:Annot1:MouseDown:Action1 ***********/

highlightTextField();


var f1 = this.getField("controlstring");
var f2 = this.getField("titleno");
var f3 = this.getField("name");
var f4 = this.getField("endquote");
var f5 = this.getField("filename");
var out = this.getField("nospaces");
var out2 = this.getField("toupper");
var out3 = this.getField("noperiod");
var str = f3.value;
str = str.replace(/ /g,"");
out.value = str;

var str2= out.value;
str2 = str2.toUpperCase();
out2.value = str2;

var str3 = out2.value;
str3 = str3.replace(/[\.,-;:&]/g, "");
out3.value = str3;

f5.value = f1.value + f2.value + "PS" + out3.value + f4.value;
var created = "Document created : \n"
var date = this.getField("date");
var today= util.printd("ddd mmm dd + yyyy", new Date());
var ar = today.split(/ /);

var postfix = "";
if (ar[2] == 1 || ar[2] == 21 || ar[2] == 31)
   postfix = "st";
else if (ar[2] == 23 || ar[2] == 3)
   postfix = "rd" ;
else if (ar[2] == 2 ||  ar[2] == 22)
   postfix = "nd";
else
   postfix = "th";

today = ar[0] + " " + ar[1] + " " + ar[2] + postfix;
var year= util.printd("yyyy", new Date());

date.value = created + today + " " + year;
date.fillColor= color.white;
date.textColor = color.black;
var titlenum = this.getField("titleno");
var id = this.getField("id");
id.value = titlenum.value + "-" + Math.round(Math.random() * 99999)
//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>Radio Button1:Annot2:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Radio Button1:Annot2:MouseUp:Action1 ***********/

highlightTextField();


var f1 = this.getField("controlstring");
var f2 = this.getField("titleno");
var f3 = this.getField("name");
var f4 = this.getField("endquote");
var f5 = this.getField("filename");
var out = this.getField("nospaces");
var out2 = this.getField("toupper");
var out3 = this.getField("noperiod");
var str = f3.value;
str = str.replace(/ /g,"");
out.value = str;

var str2= out.value;
str2 = str2.toUpperCase();
out2.value = str2;

var str3 = out2.value;
str3 = str3.replace(/[\.,-;:&]/g, "");
out3.value = str3;

f5.value = f1.value + f2.value + "PS" + out3.value + f4.value;
var created = "Document created : \n"
var date = this.getField("date");
var today= util.printd("ddd mmm dd + yyyy", new Date());
var ar = today.split(/ /);

var postfix = "";
if (ar[2] == 1 || ar[2] == 21 || ar[2] == 31)
   postfix = "st";
else if (ar[2] == 23 || ar[2] == 3)
   postfix = "rd" ;
else if (ar[2] == 2 ||  ar[2] == 22)
   postfix = "nd";
else
   postfix = "th";

today = ar[0] + " " + ar[1] + " " + ar[2] + postfix;
var year= util.printd("yyyy", new Date());

date.value = created + today + " " + year;
date.fillColor= color.white;
date.textColor = color.black;
var titlenum = this.getField("titleno");
var id = this.getField("id");
id.value = titlenum.value + "-" + Math.round(Math.random() * 99999)
//</ACRO_script>
//</AcroForm>

--end




FORM 2 with 2 buttons (not working)

---start

//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------

//<Document-Level>
//<ACRO_source>highlight</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:highlight ***********/
function highlight(f, selected)
{
    // set some default style parameters
   
    f.richText = true; // this field does contain rich text
    f.multiline = true; // multiline

    var currentText = f.value;

    var spans = new Array();

    spans[0] = new Object();
    spans[0].text = currentText;

    if (selected)
    {
        spans[0].fontWeight = 700;
        spans[0].textSize = 16;      
    }
    else
    {
        spans[0].fontWeight = 400;
        spans[0].textSize = 14;
    }
   
    f.richValue = spans;
}
//</ACRO_script>
//</Document-Level>

//<Document-Level>
//<ACRO_source>highlightTextField();</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:highlightTextField(); ***********/
function highlightTextField()
{
    // get the current setting of the radio button
    var selected = this.getField("Radio Button1").value;

    highlight(this.getField("nocase"), selected==0);
    highlight(this.getField("case"), selected==1);
    highlight(this.getField("social"), selected==2);
}
//</ACRO_script>
//</Document-Level>

//<AcroForm>
//<ACRO_source>Radio Button1:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Radio Button1:Annot1:MouseUp:Action1 ***********/

highlightTextField();


var f1 = this.getField("controlstring");
var f2 = this.getField("titleno");
var f3 = this.getField("name");
var f4 = this.getField("endquote");
var f5 = this.getField("filename");
var out = this.getField("nospaces");
var out2 = this.getField("toupper");
var out3 = this.getField("noperiod");
var str = f3.value;
str = str.replace(/ /g,"");
out.value = str;

var str2= out.value;
str2 = str2.toUpperCase();
out2.value = str2;

var str3 = out2.value;
str3 = str3.replace(/[\.',;:&-]/g, "");
out3.value = str3;

f5.value = f1.value + f2.value + "BK" + out3.value + f4.value;
var created = "Document created : \n"
var date = this.getField("date");
var today= util.printd("ddd mmm dd + yyyy", new Date());
var ar = today.split(/ /);

var postfix = "";
if (ar[2] == 1 || ar[2] == 21 || ar[2] == 31)
   postfix = "st";
else if (ar[2] == 23 || ar[2] == 3)
   postfix = "rd" ;
else if (ar[2] == 2 ||  ar[2] == 22)
   postfix = "nd";
else
   postfix = "th";

today = ar[0] + " " + ar[1] + " " + ar[2] + postfix;
var year= util.printd("yyyy", new Date());

date.value = created + today + " " + year;
date.fillColor= color.white;
date.textColor = color.black;
var titlenum = this.getField("titleno");
var id = this.getField("id");
id.value = titlenum.value + "-" + Math.round(Math.random() * 99999)

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "up-middle";
this.print(pp);

var pp2 = this.getPrintParams();
pp2.interactive = pp.constants.interactionLevel.automatic;
pp2.printerName = "Bankruptcy and Patriot";
this.print(pp2);

//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>Radio Button1:Annot2:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Radio Button1:Annot2:MouseUp:Action1 ***********/


highlightTextField();


var f1 = this.getField("controlstring");
var f2 = this.getField("titleno");
var f3 = this.getField("name");
var f4 = this.getField("endquote");
var f5 = this.getField("filename");
var out = this.getField("nospaces");
var out2 = this.getField("toupper");
var out3 = this.getField("noperiod");
var str = f3.value;
str = str.replace(/ /g,"");
out.value = str;

var str2= out.value;
str2 = str2.toUpperCase();
out2.value = str2;

var str3 = out2.value;
str3 = str3.replace(/[\.',;:&-]/g, "");
out3.value = str3;

f5.value = f1.value + f2.value + "BK" + out3.value + f4.value;
var created = "Document created : \n"
var date = this.getField("date");
var today= util.printd("ddd mmm dd + yyyy", new Date());
var ar = today.split(/ /);

var postfix = "";
if (ar[2] == 1 || ar[2] == 21 || ar[2] == 31)
   postfix = "st";
else if (ar[2] == 23 || ar[2] == 3)
   postfix = "rd" ;
else if (ar[2] == 2 ||  ar[2] == 22)
   postfix = "nd";
else
   postfix = "th";

today = ar[0] + " " + ar[1] + " " + ar[2] + postfix;
var year= util.printd("yyyy", new Date());

date.value = created + today + " " + year;
date.fillColor= color.white;
date.textColor = color.black;
var titlenum = this.getField("titleno");
var id = this.getField("id");
id.value = titlenum.value + "-" + Math.round(Math.random() * 99999)

var pp2 = this.getPrintParams();
pp2.interactive = pp2.constants.interactionLevel.automatic;
pp2.printerName = "up-middle"
this.print(pp2);

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "Bankruptcy and Patriot"
this.print(pp);

//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>Radio Button1:Annot3:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:Radio Button1:Annot3:MouseUp:Action1 ***********/

highlightTextField();


var f1 = this.getField("controlstring");
var f2 = this.getField("titleno");
var f3 = this.getField("name");
var f4 = this.getField("endquote");
var f5 = this.getField("filename");
var out = this.getField("nospaces");
var out2 = this.getField("toupper");
var out3 = this.getField("noperiod")
var str = f3.value;
str = str.replace(/ /g,"");
out.value = str;

var str2= out.value;
str2 = str2.toUpperCase();
out2.value = str2;

var str3 = out2.value;
str3 = str3.replace(/[\.',;:&-]/g, "");
out3.value = str3;

f5.value = f1.value + f2.value + "BK" + out3.value + f4.value;
var created = "Document created : \n"
var date = this.getField("date");
var today= util.printd("ddd mmm dd + yyyy", new Date());
var ar = today.split(/ /);

var postfix = "";
if (ar[2] == 1 || ar[2] == 21 || ar[2] == 31)
   postfix = "st";
else if (ar[2] == 23 || ar[2] == 3)
   postfix = "rd" ;
else if (ar[2] == 2 ||  ar[2] == 22)
   postfix = "nd";
else
   postfix = "th";

today = ar[0] + " " + ar[1] + " " + ar[2] + postfix;
var year= util.printd("yyyy", new Date());

date.value = created + today + " " + year;
date.fillColor= color.white;
date.textColor = color.black;
var titlenum = this.getField("titleno");
var id = this.getField("id");
id.value = titlenum.value + "-" + Math.round(Math.random() * 99999)

var pp = this.getPrintParams();
pp.interactive = pp.constants.interactionLevel.automatic;
pp.printerName = "up-middle";
this.print(pp);

var pp2 = this.getPrintParams();
pp2.interactive = pp2.constants.interactionLevel.automatic;
pp2.printerName = "Bankruptcy and Patriot";
this.print(pp2);


//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>county:Keystroke</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:county:Keystroke ***********/
/* This version updates a secondary combobox based on the entry selected by
** the user dynamically. The keystroke event should be processed until the
** value is about to be committed (as indicated by event.willCommit). */
if (!event.willCommit) {
     var f = this.getField("district");
     f.clearItems();
       
     /* In a keystroke event, event.change contains the non-export value of
     ** the item selected by the user. */
     switch (event.change) {
          case "Suffolk":
               f.setItems(["Eastern"]);
                break;
                case "Nassau":
               f.setItems(["Eastern"]);
          break;
          case "Kings":
               f.setItems(["Eastern"]);
          break;
          case "Queens":
               f.setItems(["Eastern"]);
          break;
          case "Richmond":
               f.setItems(["Eastern"]);
          break;
          case "Broome":
               f.setItems(["Northern"]);
          break;
          case "Cayuga":
               f.setItems(["Northern"]);
          break;
          case "Albany":
               f.setItems(["Northern"]);
          break;
          case "Bronx":
               f.setItems(["Southern"]);
          break;
          case "Allegheny":
               f.setItems(["Western"]);
          break;
                case "Chenango":
               f.setItems(["Northern"]);
          break;
                case "Clinton":
               f.setItems(["Northern"]);
          break;
                case "Columbia":
                        f.setItems(["Northern"]);
                break;
                case "Cortland":
                        f.setItems(["Northern"]);
                break;
                case "Delaware":
                        f.setItems(["Northern"]);
                break;
                case "Essex":
                        f.setItems(["Northern"]);
                break;
                case "Franklin":
                        f.setItems(["Northern"]);
                break;
                case "Fulton":
                        f.setItems(["Northern"]);
                break;
                case "Greene":
                        f.setItems(["Northern"]);
                break;
                case "Hamilton":
                        f.setItems(["Northern"]);
                break;
                case "Herkimer":
                        f.setItems(["Northern"]);
                break;
                case "Jefferson":
                        f.setItems(["Northern"]);
                break;
                case "Lewis":
                        f.setItems(["Northern"]);
                break;
                case "Madison":
                        f.setItems(["Northern"]);
                break;
                case "Montgomery":
                        f.setItems(["Northern"]);
                break;
                case "Oneida":
                        f.setItems(["Northern"]);
                break;
                case "Onondaga":
                        f.setItems(["Northern"]);
                break;
                case "Oswego":
                        f.setItems(["Northern"]);
                break;
                case "Otsego":
                        f.setItems(["Northern"]);
                break;
                case "Rensselaer":
                        f.setItems(["Northern"]);
                break;
                case "Saint Lawrence":
                        f.setItems(["Northern"]);
                break;
                case "Saratoga":
                        f.setItems(["Northern"]);
                break;
                case "Schoharie":
                        f.setItems(["Northern"]);
                break;
                case "Schenctedy":
                        f.setItems(["Northern"]);
                break;
                case "Tioga":
                        f.setItems(["Northern"]);
                break;
                case "Tompkins":
                        f.setItems(["Northern"]);
                break;
                case "Ulster":
                        f.setItems(["Northern"]);
                break;
                case "Warren":
                        f.setItems(["Northern"]);
                break;
                case "Washington":
                        f.setItems(["Northern"]);
                break;
                case "Dutchess":
               f.setItems(["Southern"]);
          break;
                case "New York":
               f.setItems(["Southern"]);
          break;
                case "Orange":
               f.setItems(["Southern"]);
          break;
                case "Putnam":
               f.setItems(["Southern"]);
          break;
                case "Rockland":
               f.setItems(["Southern"]);
          break;
                case "Sullivan":
               f.setItems(["Southern"]);
          break;
                case "Westchester":
               f.setItems(["Southern"]);
          break;
                case "Waters":
               f.setItems(["Southern"]);
          break;
                case "Cattaraugus":
               f.setItems(["Western"]);
          break;
                case "Chautauqua":
               f.setItems(["Western"]);
          break;
                case "Chemug":
               f.setItems(["Western"]);
          break;
                case "Erie":
               f.setItems(["Western"]);
          break;
                case "Genesee":
               f.setItems(["Western"]);
             break;
                case "Livingston":
               f.setItems(["Western"]);
          break;
                case "Monroe":
               f.setItems(["Western"]);
          break;
                case "Niagara":
               f.setItems(["Western"]);
          break;
                case "Ontario":
               f.setItems(["Western"]);
          break;
                case "Orleans":
               f.setItems(["Western"]);
          break;
                case "Schuyler":
               f.setItems(["Western"]);
          break;
                case "Seneca":
               f.setItems(["Western"]);
          break;
                case "Steuben":
               f.setItems(["Western"]);
          break;
                case "Wayne":
               f.setItems(["Western"]);
          break;                
                case "Wyoming":
               f.setItems(["Western"]);
          break;
                case "Yates":
               f.setItems(["Western"]);
          break;

     }
}
//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>reset:Annot1:MouseUp:Action1</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:reset:Annot1:MouseUp:Action1 ***********/
var clr = this.getField("date");
clr.value = "";

//</ACRO_script>
//</AcroForm>

//<AcroForm>
//<ACRO_source>search:Keystroke</ACRO_source>
//<ACRO_script>
/*********** belongs to: AcroForm:search:Keystroke ***********/
if (!event.willCommit) {
     var f = this.getField("county");
        var g = this.getField("district");
     

     /* In a keystroke event, event.change contains the non-export value of
     ** the item selected by the user. */
     switch (event.change) {
          case "Suffolk":
               f.setItems(["Suffolk"]);
                        g.setItems(["Eastern"]);
          break;
                case "Nassau":
                        f.setItems(["Nassau"]);
                        g.setItems(["Eastern"]);
                break;
                case "Kings":
                        f.setItems(["Kings"]);
                        g.setItems(["Eastern"]);
                break;
                case "Queens":
                        f.setItems(["Queens"]);
                        g.setItems(["Eastern"]);
                break;
                case "Richmond":
                        f.setItems(["Richmond"]);
                        g.setItems(["Eastern"]);
                break;
                case "Broome":
                        f.setItems(["Broome"]);
                        g.setItems(["Northern"]);
                break;
                case "Cayuga":
                        f.setItems(["Cayuga"]);
                        g.setItems(["Northern"]);
                break;
                case "Albany":
                        f.setItems(["Albany"]);
                        g.setItems(["Northern"]);
                break;
                case "Bronx":
                        f.setItems(["Bronx"]);
                        g.setItems(["Southern"]);
                break;
                case "Yates":
                        f.setItems(["Yates"]);
                        g.setItems(["Western"]);
                break;
                case "Allegheny":
                        f.setItems(["Allegheny"]);
                        g.setItems(["Western"]);
                break;
                case "Chenango":
                        f.setItems(["Chenango"]);
                        g.setItems(["Northern"]);
                break;
                case "Clinton":
                        f.setItems(["Clinton"]);
                        g.setItems(["Northern"]);
                break;
                case "Columbia":
                        f.setItems(["Columbia"]);
                        g.setItems(["Northern"]);
                break;
                case "Cortland":
                        f.setItems(["Cortland"]);
                        g.setItems(["Northern"]);
                break;
                case "Delaware":
                        f.setItems(["Delaware"]);
                        g.setItems(["Northern"]);
                break;
                case "Essex":
                        f.setItems(["Essex"]);
                        g.setItems(["Northern"]);
                break;
                case "Franklin":
                        f.setItems(["Franklin"]);
                        g.setItems(["Northern"]);
                break;
                case "Fulton":
                        f.setItems(["Fulton"]);
                        g.setItems(["Northern"]);
                break;
                case "Greene":
                        f.setItems(["Greene"]);
                        g.setItems(["Northern"]);
                break;
                case "Hamilton":
                        f.setItems(["Hamilton"]);
                        g.setItems(["Northern"]);
                break;
                case "Herkimer":
                        f.setItems(["Herkimer"]);
                        g.setItems(["Northern"]);
                break;
                case "Jefferson":
                        f.setItems(["Jefferson"]);
                        g.setItems(["Northern"]);
                break;
                case "Lewis":
                        f.setItems(["Lewis"]);
                        g.setItems(["Northern"]);
                break;
                case "Madison":
                        f.setItems(["Madison"]);
                        g.setItems(["Northern"]);
                break;
                case "Montgomery":
                        f.setItems(["Montgomery"]);
                        g.setItems(["Northern"]);
                break;
                case "Oneida":
                        f.setItems(["Oneida"]);
                        g.setItems(["Northern"]);
                break;
                case "Onondaga":
                        f.setItems(["Onondaga"]);
                        g.setItems(["Northern"]);
                break;
                case "Oswego":
                        f.setItems(["Oswego"]);
                        g.setItems(["Northern"]);
                break;
                case "Otsego":
                        f.setItems(["Otsego"]);
                        g.setItems(["Northern"]);
                break;
                case "Rensselaer":
                        f.setItems(["Rensselaer"]);
                        g.setItems(["Northern"]);
                break;
                case "Saint Lawrence":
                        f.setItems(["Saint Lawrence"]);
                        g.setItems(["Northern"]);
                break;
                case "Saratoga":
                        f.setItems(["Saratoga"]);
                        g.setItems(["Northern"]);
                break;
                case "Schoharie":
                        f.setItems(["Schoharie"]);
                        g.setItems(["Northern"]);
                break;
                case "Schenctedy":
                        f.setItems(["Schenctedy"]);
                        g.setItems(["Northern"]);
                break;
                case "Tioga":
                        f.setItems(["Tioga"]);
                        g.setItems(["Northern"]);
                break;
                case "Tompkins":
                        f.setItems(["Tompkins"]);
                        g.setItems(["Northern"]);
                break;
                case "Ulster":
                        f.setItems(["Ulster"]);
                        g.setItems(["Northern"]);
                break;
                case "Warren":
                        f.setItems(["Warren"]);
                        g.setItems(["Northern"]);
                break;
                case "Washington":
                        f.setItems(["Washington"]);
                        g.setItems(["Northern"]);
                break;
                case "Dutchess":
                        f.setItems(["Dutchess"]);
                        g.setItems(["Southern"]);
                break;
                case "New York":
                        f.setItems(["New York"]);
                        g.setItems(["Southern"]);
                break;
                case "Orange":
                        f.setItems(["Orange"]);
                        g.setItems(["Southern"]);
                break;
                case "Putnam":
                        f.setItems(["Putnam"]);
                        g.setItems(["Southern"]);
                break;
                case "Rockland":
                        f.setItems(["Rockland"]);
                        g.setItems(["Southern"]);
                break;
                case "Sullivan":
                        f.setItems(["Sullivan"]);
                        g.setItems(["Southern"]);
                break;
                case "Westchester":
                        f.setItems(["Westchester"]);
                        g.setItems(["Southern"]);
                break;
                case "Waters":
                        f.setItems(["Waters"]);
                        g.setItems(["Southern"]);
                break;
                case "Cattaraugus":
                        f.setItems(["Cattaraugus"]);
                        g.setItems(["Western"]);
                break;
                case "Chautauqua":
                        f.setItems(["Chautauqua"]);
                        g.setItems(["Western"]);
                break;
                case "Chemung":
                        f.setItems(["Chemung"]);
                        g.setItems(["Western"]);
                break;
                case "Erie":
                        f.setItems(["Erie"]);
                        g.setItems(["Western"]);
                break;
                case "Genesee":
                        f.setItems(["Genesee"]);
                        g.setItems(["Western"]);
                break;
                case "Livingston":
                        f.setItems(["Livingston"]);
                        g.setItems(["Western"]);
                break;
                case "Monroe":
                        f.setItems(["Monroe"]);
                        g.setItems(["Western"]);
                break;
                case "Niagara":
                        f.setItems(["Niagara"]);
                        g.setItems(["Western"]);
                break;
                case "Ontario":
                        f.setItems(["Ontario"]);
                        g.setItems(["Western"]);
                break;
                case "Orleans":
                        f.setItems(["Orleans"]);
                        g.setItems(["Western"]);
                break;
                case "Schuyler":
                        f.setItems(["Schuyler"]);
                        g.setItems(["Western"]);
                break;
                case "Seneca":
                        f.setItems(["Seneca"]);
                        g.setItems(["Western"]);
                break;
                case "Steuben":
                        f.setItems(["Steuben"]);
                        g.setItems(["Western"]);
                break;
                case "Wayne":
                        f.setItems(["Wayne"]);
                        g.setItems(["Western"]);
                break;
                case "Wyoming":
                        f.setItems(["Wyoming"]);
                        g.setItems(["Western"]);
                break;

}
}

//</ACRO_script>
//</AcroForm>




---end
0
Comment
Question by:jerrycsakanyjr
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
I found your question, but it will take a while to walk through the code. I'll be back ...
0
 

Author Comment

by:jerrycsakanyjr
Comment Utility
Would help if i just emailed you the forms ?
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
EE prefers that you make it available on the web (so that other experts also have access to it).
If this is not possible, you can find my email address in my profile.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 44

Expert Comment

by:Karl Heinz Kremer
Comment Utility
Did you send the files?

There is a lot of duplicate code in the button handlers. You should factor this out into a document level function (the same way you are doing this for the highlight() function).

I looked at the code, but without the actual form, it's pretty complicated (almost impossible) to find out what's wrong. I started to recreate your forms, but had to stop because I have no idea if my interpretation of your code is correct. So, if you can make the actual files available, it would be much easier.
0
 

Author Comment

by:jerrycsakanyjr
Comment Utility
Link to website that has both forms you can download:

http://www.boundlessbeauty.net/pdf.html
0
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
Comment Utility
The first radio button on the form that does not work correctly uses a "Mouse Down" action, the second one uses a "Mouse Up" action. All three buttons on the form use "Mouse Up" actions. So, if you change the action of the first button to "Mouse Up" the form will work correctly.

The reason this does not work correctly is that when the mouse-down button is received, the checkbox is not yet selected, so you are getting the previous state (which still is set to 1). The radio button is selected of course when you click on it the second time, so you get the correct behavior in this case.
0
 

Author Comment

by:jerrycsakanyjr
Comment Utility
Thank you!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
The Adobe PDF proprietary file format is recognized as secure and formulated. But these PDF files are also prone to corruption and any external threat like virus attacks, improper storage can hit PDF file integrity.This type of damages can make cruc…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now