faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 15 people (7%) answered Yes
Recently 1 of 10 people (10%) answered Yes

Entry

dynamically populate select from the jsp

Apr 8th, 2008 18:12
ha mo, alok agarwal,


<html>
<head>
<script language="JavaScript">
function pop()
{ 
var x=0;
var counter=0;
var match="GBP";
for(x = 0;x<(document.formname.market.length);x++)
{
if(document.formname.market.options[x].text==match)
document.formname.market.options[x].selected =x;
}
}
</script>
</head>
<body>
<form name="formname">
<select name="market" size="1" id="market" readonly="false">
        <option>USCC-Direct</option>
        <option>USCC-East</option>
        <option>USCC-West</option>
        <option>USCC-South</option>
        <option>USCC-Central</option>
        <option>USCC-Southwest</option>
        <option>USCC-CAAD</option>
        <option>MNC-East</option>
        <option>MNC-West</option>
        <option>GBP</option>
      </select></form>
<input type="button" value = "Alok Selection" onClick="pop()">
</body>
</html>
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com