Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTA with Editable dropdown listbox

Status
Not open for further replies.

cluM09

Technical User
May 15, 2004
127
US
Hello,

I need to create an editable dropdown list box on an HTA form.

I found the html and javascript code that will do the editable dropdown listbox which is listed below which works fine. However, I like to know how I can convert the code to use vbscript instead of javascript.

Any help will be greatly appreciated.

**************** Code sample *******************
<html>
<head>
<title>Editable Dropdown</title>

<HTA:APPLICATION
ID="objScriptFromText"
APPLICATIONNAME="EditableDropdown"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
SCROLL="auto"
SINGLEINSTANCE="yes"
ICON = "ICON.ICO"
>

</head>

<script type="text/javascript">

function displaytxtbox(x)
{
var displaytxtbox="txtbox"+x;
var displaytxtbox=document.all(displaytxtbox);
displaytxtbox.style.display="";
}
function removelist(x)
{
var removelist="list"+x;
var useremovelist = removelist;
var removelist=document.all(removelist);
removelist.style.display="none";
}
function zipcode(a)
{
if (a == "NEW") {
removelist(1);
displaytxtbox(1);
document.OrganizationForm.zip_code.value='';
}
}

</script>

<body bgcolor="buttonface">

<form name="OrganizationForm">
<input type="text" name="zip_code" size="10" id="txtbox1" style="display: none;">

<select style="width: 90px;" name="choose_zip_code" id="list1" onChange="zipcode(this.form.choose_zip_code.value);return true;">

<option value="60601">60601</option>
<option value="77777">77777</option>
<option value="NEW">NEW</option>

</select>
</form>
</body>
</html>

 
functions = sub if there is no return value

var = dim but do the assignment separately
eg var useremovelist = removelist;
dim useremovelist: useremovelist = removelist
Note that javascript does not differentiate between let and set. If removelist is not a basic type then you need to use set.

if (a=="NEW") {
...
}

becomes

if a="NEW" then
...
end if

displaytxtbox(1);

becomes either

call displaytxtbox(1)

or

displaytxtbox 1

And that's it. Have fun translating.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top