How to set a value for a combobox in a Web page using VB script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • susinthaa
    New Member
    • Jun 2007
    • 30

    How to set a value for a combobox in a Web page using VB script?

    Hi,

    I am trying to automate a web page using VB script.

    <label>
    Login Method</label></div>
    <div class="cmb_fld" >
    <select name="loginMeth od" onchange="OnLog inMethodChanged ();">
    <option>
    Select Login Method</option>
    <option value="SCR">
    Challenge RESP</option>
    <option value="SOP">
    Safeword</option>
    </select>
    </div>

    Function
    function OnLoginMethodCh anged() {
    if (document.forms[0].loginMethod.se lectedIndex == 4) {
    var userLang = document.forms["Login"].elements["language"].value;

    When I try to use the below command to select the value for the combo box, it is not working and getting a error message.

    IE.document.for ms[0].("loginMethod" ).Value = "SP"

    Please help me on this.

    Thanks in advance.
  • C CSR
    New Member
    • Jan 2012
    • 144

    #2
    Your function doesn't look like VBScript. It looks like javascript. Reply with some clarification? VBScript or Javascript?

    Comment

    Working...