Close a blank application when it shows as a modal window

dear SC Forum,

does anyone here know how to close a blank application when it shows as a modal?
AFAIK, blank application is a pure php file.
i only need a single link or button which i can click to close the modal and back to the previous application.

simply like that, but i don’t have any idea. i’ve searched such this article here, but now can not be accessed (perhaps my internet trouble).
here the code i found so far from this forum

echo "<a href='#' onclick="parent.location='../app/app.php'" >Close</a>";

error…doesn’t work properly.
i tried this also…only works when the blank application is open in another windows (not a modal).

echo( "<a href=\"#\" onclick=\"window.close(); return false\">Close</a>")

any idea?

I’m not sure, but afaik you can use macro’s. I would start with sc_exit. See helpdocumentation for that.

i only have 1 even in a blank application, that’s onExecute.
if i use sc_exit(ref) in this event, should it be an auto close if it works? not a link or button which i can click to close the modal window?


Isn’t the issue happening because you used double quotes instead of single quotes?

echo “<a href=’#’ onclick='parent.location=’…/app/app.php’” >Close</a>";

hi bartho :slight_smile:

i’ve tried with single and double quotes. basically, i need to know how to close the blank application and back to the previous application when blank application shows as a modal. just like other applications when it shows as a modal, they have button or link to close them.

the blank application has only 1 event, onExecute. i searched through this forum and google, it’s hard to find a simple example about this.

would you give me a simple script or clue what should i do just to close the blank application and back to the previous grid or form? the blank application remains on top once it shows.


Have you tried to use sc_exit?

Bernhard Bernsmann


Have you tried to use sc_exit?

Bernhard Bernsmann

yes bernhard.

i tried in the very beginning of the code like this below:

//then the rest of code below

or like this:

//the code above

i put the sc_exit() in the onExecute event.

both of them doesn’t work. the blank application is working properly as a modal without the way to close unless i click other menu to load other application.


Please contact our support regarding this issue. Our chat is active on workdays from 8:00am to 6:00pm (GMT -3), and our ticket system is always available.

Bernhard Bernsmann

thanks bernhard.
i will create a ticket for this :slight_smile:

If you get a valid reply, would you be so kind to put the answer here? I’m curious!

sure albert :slight_smile:

i will update the solution once it solves the case.

this would be helpfull to a lot of developers which are using SC.

did you try something like: echo “<a href=’…/form_sprecher_score/form_sprecher_score.php’ target=’_parent’>Return</a>”;

Or if you don’t need a user confirmation a simple sc_redir(yourform,"_parent") will do it.

It works for me.



thanks jsbinca.
i interest with sc_redir solution. would you mind if you give me 1 or 2 lines of example using sc_redir?
should i use in echo "sc_redir or just simply type sc_redir?
sc_redir will not give you a button or link for clickable to close the modal window.

do you mean sc_redir with <a href solution ?

if you get a response from support, please put it here in this forum is good to know that do for that.

yes alvagar :slight_smile:

i already get 1 respon as solution.
still trying out now and will post here once it works propely closing the modal window

Hi ivanpc,
it depends on your needs. When I want the user to actively close the window I put a link at the end of the page:

echo “<a href=’…/form_score2/form_scores.php’ target=’_parent’>Click here to return</a>”; //(of course with a little formatting or image)

In case I don’t need the user to interact, I just put a simple redirect to the parent at the end of the script.


That’s it

idea for closing blank app as a modal

hi guys,

i got this from SC support. it’s a good idea. here is the code i get from SC support:


	function voltar()

<center><input type = "button" name = "btn_return" value = "Return" onClick = 'Javascript:voltar();'></center>


but it doesn’t work. it shows the button, but it doesn’t close the window.

Modal Blank App Cant Close 3.jpg

I’ve been patiently waiting for this solution. Looks like you might need the code from the voltar function to create a javascript method, which is being called in the sample code you gave. How did support send you this half-working solution? Contact them through the same channels and see if they can give you the javascript method code. I NEED this too :slight_smile:

give up guys…
i think for this moment, it is impossible for us to close a blank app when it shows as modal.
no solution from the tech support, unless suggesting me to open in a new window (this works…i tried many times before i searched about this).

that’s the official reply. so i better stay, waiting for the next update, perhaps SC will add some feature about “closing a blank app when it shows as a modal”.