Search the Community
Showing results for tags 'select id='.
-
Hi, I'm trying to select an item in a dropdown box but when I submit the form, seems like the item is not selected although it appeared in the box. Here is the html code of the form: <input type="hidden" id="pstad-loctnid" name="postAdForm.locationId" value="80002"/> <li> <a name="postAdForm.location"></a> <label for="locationLevel0" class="add-asterisk">Ville :</label> <div class="form-section"> <select id="locationLevel0" name="locationLevel0" req="req" class="locationSelector "> <option value="">----------</option> <option value="1700278"> Laval / Rive-Nord</option> <option value="1700279"> Longueuil / Rive-Sud</option> <option value="1700280"> Ouest de l'île</option> <option value="1700281"> Ville de Montréal</option> </select> <div class="field-message" data-for="locationLevel0"></div> <p class="message">Veuillez sélectionner votre emplacement ou un lieu près de chez vous.</p> </div> </li> ; And here is the script code I'm using: Sleep(1000) $oIEDoc = $oIE.Document $oIEBody = $oIEDoc.body $selects = $oIEBody.GetElementsByTagname("select") $numofselects = $selects.length For $r = 0 To $numofinputs - 1 $myobj = $selects.item($r) If $myobj.id = "locationLevel0" And $myobj.name="locationLevel0" Then _IEAction($myobj, "focus") $myobj.value = "1700281" ExitLoop EndIf Next ; The "Ville de Montréal" option appears in the box but when I submit the form, I get a message that it's missing this information. Please tell me what I'm doing wrong. Thanks
- 15 replies
-
- input type=hidden
- select id=
-
(and 1 more)
Tagged with: