You need to sign in to do that
Don't have an account?
vamsi krishna 106
VF page is not redirect when confirm is true?
Hi Guys,
controller
public class newpage{
public pagereference page2()
{
//here i need to redirect code...
}
}
<apex:page controller="newpage">
<script>
function conrimnew(e)
{
var con=confirm("Are u Sure>");
if(con){
return true;
else{
return false;
}
}
}
</script>
<apex:form>
<apex:inputfield value="{!some1}"/>
<apex:inputfield value="{!some2}"/>
<apex:commandbutton action="{!page2}" onclick="return conrimnew(event)" value="confirm"/>
</apex:form>
</apex:page>
but here when i click on that command button..it open the confirm box.for first time if u click on ok then it redirect to the URL.but
when i click on CANCEL..after that when i click on the button ..then i open the confirm box...but now if i click on OK..
then it is not redirect to the page...please..
help me guys..
thanks in advance..
Thanks Vamsikrishna
controller
public class newpage{
public pagereference page2()
{
//here i need to redirect code...
}
}
<apex:page controller="newpage">
<script>
function conrimnew(e)
{
var con=confirm("Are u Sure>");
if(con){
return true;
else{
return false;
}
}
}
</script>
<apex:form>
<apex:inputfield value="{!some1}"/>
<apex:inputfield value="{!some2}"/>
<apex:commandbutton action="{!page2}" onclick="return conrimnew(event)" value="confirm"/>
</apex:form>
</apex:page>
but here when i click on that command button..it open the confirm box.for first time if u click on ok then it redirect to the URL.but
when i click on CANCEL..after that when i click on the button ..then i open the confirm box...but now if i click on OK..
then it is not redirect to the page...please..
help me guys..
thanks in advance..
Thanks Vamsikrishna
[1] http://salesforce.stackexchange.com/questions/19004/visualforce-onclick-doesnt-execute-action-or-rerender