Home » Developer & Programmer » Application Express & MOD_PLSQL » Making a popup (apex)
Making a popup [message #535120] Mon, 12 December 2011 04:47 Go to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
Hello Smile,

I've been looking at making a popup and the way I've found on the internet is javascript but I have a question...Where exactly do I put the javascript? because I would like it to be conditional so I thought 'process?' but there doesn't seem to be a javascript entry bit there. If its not in a process how do I make it conditional?

Also I'm really not sure about Javascript...I don't really know what I'm doing so can someone just check this would actually work in apex? I got it of www.w3schools.com :
<script type="text/javascript">
function show_alert()
{
alert("Hello! I am an alert box!");
}
</script>

I'd like it to appear when the user enters too many people (31 or more) into item P11_COUNT. If I need to use script an example would be much appreciated

thanks Smile
Re: Making a popup [message #535127 is a reply to message #535120] Mon, 12 December 2011 05:22 Go to previous messageGo to next message
c_stenersen
Messages: 254
Registered: August 2007
Senior Member
Which version of ApEx are you running? If you're using 4.1 (Perhaps also for 4.0, I'm not sure) you can use a dynamic action for this.
Re: Making a popup [message #535133 is a reply to message #535127] Mon, 12 December 2011 05:32 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
4.0.2 it says at the bottom

how would I go about using a dynamic action if I can?
Re: Making a popup [message #535135 is a reply to message #535133] Mon, 12 December 2011 05:35 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
Ah I found 'execute javascript code' presumably thats it?
Re: Making a popup [message #535137 is a reply to message #535135] Mon, 12 December 2011 05:42 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
Ok I tried with that script I had above but it didn't seem to work...there was some writing at the very bottom of the screen:
},"action":"NATIVE_JAVASCRIPT_CODE"}]}]; }
so presumably the dynamic action is working...just not the JS
is there something wrong with it?
I really have no idea what i'm doing with javascript Confused not used it before

[Updated on: Mon, 12 December 2011 05:43]

Report message to a moderator

Re: Making a popup [message #535149 is a reply to message #535137] Mon, 12 December 2011 07:04 Go to previous messageGo to next message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
ok nvm I got it,
{
alert("Hello! I am an alert box!");
}

was all that was needed

thanks for the help c_stenersen Smile
Re: Making a popup [message #535151 is a reply to message #535137] Mon, 12 December 2011 07:08 Go to previous messageGo to next message
c_stenersen
Messages: 254
Registered: August 2007
Senior Member
When you create the item you can set it to type "number field". You can then create a dynamic action for it, choose advanced, action:key release, and on the condition you use "greater than" and 30. You can then choose notification, alert as the action, and just write your text in the text field. If this alert type isn't there (I didn't experiment very much with this in 4.0, and now I have 4.1 so it's difficult to test) you can choose "execute javascript code" and just write alert("my text here") as the code.

Edit: ok, you fixed it before I answered Smile Happy to help.

[Updated on: Mon, 12 December 2011 07:09]

Report message to a moderator

Re: Making a popup [message #535152 is a reply to message #535151] Mon, 12 December 2011 07:16 Go to previous message
balckbandit5
Messages: 104
Registered: December 2011
Senior Member
Just so you know in future I the 'Alert' action is in 4.0

thanks again
Previous Topic: Date and time when row created
Next Topic: Taken to allocated page after Login
Goto Forum:
  


Current Time: Wed Aug 20 06:11:39 CDT 2014

Total time taken to generate the page: 0.09627 seconds