Whenever I try to set any value in any of these fields, I get an "Illegal value" error from Mechanize. I also saw that there was some code that seems to populate the options, it looks like this:<div class="qsFormElement" id="qsMake"> <select name="make" onChange="myQuickSearch.setMake(this.options[t +his.selectedIndex].value)"> <option></option> </select> </div> <div class="qsFormElement" id="qsModel"> <select name="model" onChange="myQuickSearch.setModel(this.options +[this.selectedIndex].value)"> <option></option> </select> </div> <div class="qsFormElement" id="qsTrim"> <select name="trim" onChange="myQuickSearch.setTrim(this.options[t +his.selectedIndex].value)"> <option></option> </select> </div>
Anyone know how I would automate this page? Thanks!//construct new QuickSearch object, passing inventory JSData object var myQuickSearch = new QuickSearch(invJSData); function initQuickSearch(){ // this is to turn off sorting in the api; options will be display +ed in JSDO order criteriaList[MODEL_NAME].setIsPreSorted(true); criteriaList[TRIM_NAME].setIsPreSorted(true); myQuickSearch.setShowNullSearchTypes(false); myQuickSearch.init(document.forms.quickSearchForm); // if there is no "new" inventory, the "New" option does not appea +r in the dropdown. if (myQuickSearch.hasNew) setSearchType("new"); else if (myQuickSearch.hasPreowned) setSearchType("preowned"); } /* Call in the onClick of the search dropdown */ setSearchType = function(newType) { // REQUIRED: this kicks off the dropdown population. myQuickSearch.setSearchType(newType); // by default it will load all makes; this is how you get it to lo +ad models for just one make. if (newType == "preowned") myQuickSearch.setMake("Subaru"); }
In reply to WWW::Mechanize & <option>s by FrankRizzo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |