You need to sign in to do that
Don't have an account?
SurjenduK
What am I doing wrong here? I get an error which says document.getElementById("exname") does not exist. How do i refer the inputText id i created?
document.getElementById is not working for me in visualforce page? Help!!!
Code:
<apex:page controller="SamePageController" tabstyle="Lead" standardStylesheets="false" >
<script type="text/javascript">
function grabExName()
{
var ex = document.getElementById("exname").value;
alert(ex);
}
</script>
<apex:sectionHeader title="Create Extranets">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection columns="3" title="Extranet Information">
<apex:outputLabel style="font-weight:bold;" value="Extranet Name" for="exname"/>
<apex:inputText id="exname" required="true" onkeydown="grabExName()"></apex:inputText
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:sectionHeader>
</apex:page>
What am I doing wrong here? I get an error which says document.getElementById("exname") does not exist. How do i refer the inputText id i created?
try this
Message Edited by Ron Hess on 04-07-2008 08:28 PM
All Answers
and the script tag is within the <apex:pageBlock>. Still it does not work.
try this
Message Edited by Ron Hess on 04-07-2008 08:28 PM
Have you got solution for <apex:pageBlock> ?
and the script tag is within the <apex:pageBlock>. Still it does not work.
I want to design pageBlock and pageBlockSection such as background color etc.
Is there anyway to use style?
Regards,
LinThaw.
<apex:page tabstyle="Lead" standardStylesheets="false" >
<script type="text/javascript">
function grabExName(myid)
{
var ex = document.getElementById(myid).value;
alert(ex);
}
</script>
<apex:sectionHeader title="Create Extranets">
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection columns="3" title="Extranet Information">
<apex:outputLabel style="font-weight:bold;" value="Extranet Name" for="exname"/>
<apex:inputText id="exname" required="true" onkeydown="grabExName(this.id)"></apex:inputText>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:sectionHeader>
</apex:page>
try tis one
this.id is required and you can get it by myid in script