You need to sign in to do that
Don't have an account?
In window.onload function not Get Ids
Hi All,
I am not get Ids of HTML as vf elements ids . when page loading ....it shwoing null values in alert(),....canu any body help in this.
<apex:page Controller="ForeCastCls" standardStylesheets="false" >
<script type="text/javascript">
window.onload = new function() {
alert('addoption calling...');
var selectEl = document.getElementById('SelectId');
alert('select option id:'+selectEl);
var prodNameEle = document.getElementById('j_id0:akaFormId:pgblcId:apexButtonId');
alert('prodNameEle...Id:'+prodNameEle);
};
</script>
<apex:form id="akaFormId">
<HTML>
<Body>
secondary Accounts:
<select name="secondary Account" id="SelectId">
</select>
<input type="button" value="add" id="selectoptButtonId"/>
<apex:pageBlock id="pgblcId">
<apex:inputText id="apexButtonId" value="{!bondi}" ></apex:inputText>
</apex:pageBlock>
</Body>
</HTML>
</apex:form>
</apex:page>
thanks.
bondi
<select>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
is the syntax. No <option></option> in your code.
Regards,
Magulan D
Salesforce.com certified Force.com Developer.
SFDC Blog
If this post is your solution, kindly mark this as the solution.
I am adding select optinons in javascript