Get the value from dropdown list (selectedIndex) and text field -- not working


hi all,

 

i trying find , change values selected user using dropdown , text field. here code.

 

 

 

changerevdetails(); function changerevdetails(){             var mydialog = app.dialogs.add({name:"enter copyright information"});   //    var monthlist = col1.dropdowns.add('mylist', undefined, mylist);             var col1 = mydialog.dialogcolumns.add();           var col2 = mydialog.dialogcolumns.add();        col1.statictexts.add({staticlabel:"month:"});           col1.statictexts.add({staticlabel:"year:"});     col1.statictexts.add({staticlabel:"rev. no.:"});          var mylist = [ "january", "february",  "march", "april", "march", "april", "may", "june", "july", "august", "sepetember", "october", "november", "december" ];        var mymonth = col2.dropdowns.add({stringlist:mylist, selectedindex:0, minwidth:100});//{minwidth:100});      var myyear = col2.texteditboxes.add({editcontents:"2013", minwidth:100});         var myrev = col2.texteditboxes.add({minwidth:100});       var revmonth = (mylist [mymonth.selectedindex]);     var revyear = myyear.editcontents;     var revnumber = myrev.editcontents;     var revtoreplace1 = revmonth +", "+ revyear;     var revtoreplace2 = revmonth +", "+ revyear + " rev. " + revnumber;       var myresult = mydialog.show();           if(myyear.editcontents == "") //entry ""          {          alert("please enter text contents field.");          changerevdetails();          }         else if(myresult == true) //user entered datas          {                alert (revmonth);             alert (revyear);             alert (revnumber);             alert (revtoreplace1);             alert (revtoreplace2);               app.findgreppreferences = nothingenum.nothing;             app.changegreppreferences = nothingenum.nothing;               // grep find/change             app.findgreppreferences = app.changegreppreferences = null;                    app.findgreppreferences.findwhat = "[\\l\\u]+?\\s?\\d{4},?\\s+[\\l\\u]+\\.*\\s+\\d+";             app.findgreppreferences.appliedparagraphstyle = app.activedocument.paragraphstylegroups.item("back page"). paragraphstyles.item("legal_7/9");             app.changegreppreferences.changeto = revtoreplace1;             app.changegreppreferences.appliedparagraphstyle = app.activedocument.paragraphstylegroups.item("back page"). paragraphstyles.item("legal_7/9");             app.activedocument.changegrep();               app.findgreppreferences = nothingenum.nothing;             app.changegreppreferences = nothingenum.nothing;        }      else //implies user clicked cancel      {      mydialog.destroy();      }   }  

 

 

the problem is, not taking value user selects dropdown , text field. takes default value "january" , year "2013" both of these values given selectedindex:0 , editcontents:"2013". have compared coding other working scripts well, not working. have added several alert boxes check value get.

 

also, find , change not working. please me on this. thanks.

 

regards,

muthuraj. d

change order dialogresults:

 

...

var myyear = col2.texteditboxes.add({editcontents:"2013", minwidth:100});  
var myrev = col2.texteditboxes.add({minwidth:100});

 

 

 

 

 

var myresult = mydialog.show();

 

 

    if(myyear.editcontents == "") //entry ""
    {
    alert("please enter text contents field.");
    changerevdetails();
    }
    else if(myresult == true) //user entered datas
    {

 

var revmonth = (mylist [mymonth.selectedindex]);
var revyear = myyear.editcontents;
var revnumber = myrev.editcontents;
var revtoreplace1 = revmonth +", "+ revyear;

var revtoreplace2 = revmonth +", "+ revyear + " rev. " + revnumber;

...

 

 

didn't have find change problem



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

Falang and too many redirects - Joomla! Forum - community, help and support

Infinite loop detected in JErrorInfinite loop detected in JError - Joomla! Forum - community, help and support

logged out from joomla! - Joomla! Forum - community, help and support