You need to sign in to do that
Don't have an account?
Arine Yon
alert issue in page
JavaScript Problem
I have a problem with the following code:
<apex:page >
<apex:form >
<apex:commandButton value="Click" onclick="document.getElementById('sp').innerHTML='Hello'" />
<span id="sp"></span>
</apex:form>
</apex:page>
When I click on the button the value I am setting in the span tag ('Hello' in span) appears for 1 second and again disappears, I want the text 'Hello' to remain in span after clicking on the button. Can anyone please help me with this?
I have a problem with the following code:
<apex:page >
<apex:form >
<apex:commandButton value="Click" onclick="document.getElementById('sp').innerHTML='Hello'" />
<span id="sp"></span>
</apex:form>
</apex:page>
When I click on the button the value I am setting in the span tag ('Hello' in span) appears for 1 second and again disappears, I want the text 'Hello' to remain in span after clicking on the button. Can anyone please help me with this?
You are close enough try this one :
Do you notice the rerender attribute set to span id?
The commandButton refresh the complete page whereas
rerender attribute only refresh the particular block.
Hope it helps
If this answers solve your query please mark this question as a solved and best answer.
Feel Free to ask.
Regards
Ajay
All Answers
In order to solve this issue use reRender in apex command button.
You are close enough try this one :
Do you notice the rerender attribute set to span id?
The commandButton refresh the complete page whereas
rerender attribute only refresh the particular block.
Hope it helps
If this answers solve your query please mark this question as a solved and best answer.
Feel Free to ask.
Regards
Ajay