Hello!
I'm having a question here about a modal popup that just won't show up after a user has registered successfully. It should show up after a page refresh, and only if the registration was successful.
Please, if you would just take a look, then I'd be more than happy.
I know this post looks very long, but most of it is just information about what I've done. The question is rather short. ;)
A small introduction:+
I have made a custom registration field in a modal popup on page 101 (the login page). When a user clicks on the button 'register', then this modal popup opens. This popup is in fact a region.
This all works well.
When the visitor has filled in all fields of the registration form, and when the user has entered valid information (I have validations on every field), then the page refreshes (or submits) and the user has been registered in the USERS table in my database. He or she then gets an email for confirmation.
What I want:+
As soon as the page refreshes, I want a new modal popup to pop open saying "You have successfully been registered!". I've made this modal popup, tested it out with a button, and this all works well. However, I just can't seem to find out how to make it show up after a registration has been successful...
What I have:+
Two working modal popups (that are in fact regions). These are made with the following code:
<link rel="stylesheet" href = "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"> </script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"> </script>
<script type="text/javascript">
$( function(){
$('#ModalForm').dialog(
{
modal: true,
autoOpen: false,
width: 500,
height: 350,
buttons:{
Cancel: function(){
closeForm();},
Register: function()
{
$('#ModalForm input[type="varchar2"]').removeClass('ui-state-error');
var valid = true;
$('#ModalForm input[type="varchar2"]').each( function()
{
if( $(this).val().length == 0)
{
$(this).addClass('ui-state-error');
message = 'Error: ' + $(this).attr('id').substr(3).replace('_' , ' ') + ' is blank';
$('.msg').text( message );
valid = false;
return false;
}
});
if( valid )
{
addPerson();
}
}
}
});
$('#ModalConf').dialog(
{
modal: true,
autoOpen: true,
width: 300,
height: 100
});
});
function openForm()
{
$('#ModalForm').dialog('open');
}
function openForm2()
{
$('#ModalConf').dialog('open');
}
function closeForm()
{
$('#ModalForm input[type="varchar2"]').val('');
$('#ModalForm').dialog('close');
$('#ModalConf').dialog('close');
}
function addPerson()
{
var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=addUser', 101);
ajaxRequest.add( 'P101_USERN', $v('P101_USERN'));
ajaxRequest.add( 'P101_PASSW', $v('P101_PASSW'));
ajaxRequest.add( 'P101_PASSW2', $v('P101_PASSW2'));
ajaxRequest.add( 'P101_EMAIL', $v('P101_EMAIL'));
var gReturn = ajaxRequest.get();
if(gReturn)
{alert (gReturn)}
else
{ajaxRequest = null;
closeForm();
doSubmit('SEARCH');}
}
</script>
The first region (registration form) has the following in the Region Header:
<div id="ModalForm" title="Registration form" style="display:none">
<p class="msg">(*) Marks are mandatory</p>
In Region Footer, there's just a close tag for the div.
The second region (the confirmation message) has the following in the Region Header:
<div id="ModalConf" title="Registration successful" style="display:none">
<p class="msg">
You are now successfully registered!
<br/>
Please follow the instructions in our activation email to activate your account.
</p>
In Region Footer, there is just a close tag for the div.
Condition Type: Value of Item/Column in Expression 1 = Expression 2
Expression 1: P101_CONFIRM_REGISTRATION (+this is a hidden item)+
Expression 2: Y
Upon pressing the 'Register' button in the first region (the registration form), an application process runs and it has the following line to set the hidden item to Y:
:P101_CONFIRM_REGISTRATION := 'Y';
So, this means that when the registration is successful, the hidden item P101_CONFIRM_REGISTRATION gets the value Y. By default, this is N._
I've set the conditions for the confirmation region to only show when the above item has Y as a value. Yet, it still doesn't show up!
APEX version: 4.1.1.00.23
Browser: Mozilla Firefox
OS: Oracle Linux