|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Canīt close window (code sample)
The problem is, if no errors the empty table from TabUserServerValidar() shows before this one (TabUserRedirect), and get two pages and two tables. I already tried to close that page, as you can see, but doesn't work. Heres the code:
<% '.................... FORM SUB calls TabUserBDinsert() Sub TabUserBDinsert() If TabUserServerValidar("insert") = 1 then 'Before send the data it checks server side fields Opens_BD() SQLstm="Insert into TABLE(.....................)" rs.Open SQLstm,Lig,1,2 Close_BD() TabUserRedirect() ' If no errors go to new page end if End sub Function TabUserServerValidar(testeLg) Response.Write "<HTML><head><Link rel='stylesheet' type='text/css' href='../Fsource/Base_CSS_Geral.css'>" Response.Write "</head>" Response.Write "<body Class='Geral'>" Response.Write "<CENTER><BIG><b><font color='white'>ERRORS</font></b></BIG></CENTER><BR>" TESTE=1 Response.Write "<CENTER>" Response.Write "<FORM id=formUserServerError name=formUserServerError>" Response.Write "<TABLE Class=form>" Response.Write "<TR><TD>" mail=Request.Form ("mail") if len(mail)> 0 then if len(mail)> 70 then Response.Write "O mail não pode exceder os 70 carateres e colocou <B>" & len(mail) TESTE=0 end if end if Response.Write "</TD></TR>" Response.Write "</TABLE></CENTER>" Response.Write "<CENTER>" Response.Write "<TABLE border =0>" Response.Write "<TR><TD align='center' ><input type=button value=Back onClick='javascript:history.back(-1)' id=button1 name=button1></TD></TR>" Response.Write "</TABLE>" Response.Write "</FORM>" TabUserServerValidar=teste 'return teste value to TabUserBDinsert Response.Write "</body></html>" End Function Sub TabUserRedirect() ' this is a page option for user to decide directions Response.Write "<HTML><head><Link rel='stylesheet' type='text/css' href='../Fsource/Base_CSS_Geral.css'>" Response.Write "</head>" Response.Write "<body Class='Geral'>" Response.Write "<CENTER><BIG><b><font color='white'>DATA OK</font></b></BIG></CENTER><BR>" Response.write"<center>" Response.write"<table class='dadosOk'>" Response.write"<tr>" Response.write"<td Class='dadosOk'><a href='#' onClick='javascript:document.self.close();'>OUT 2 teste</td>" Response.write"</tr>" Response.write"</table>" Response.write"</center>" Response.Write "</body></html>" End Sub %>
__________________
atferraz |
|
#2
|
|||
|
|||
|
well there's a lot of unnecesary code
window.close(); not document.self i've never heard of the self keyword but it'd be easier to just say document.myform..etc, but even easier is window.close(); =) |
|
#3
|
|||
|
|||
|
already tried. window.close(), window.self.close(), document.close() and document.self.close(). Thatīs why I put the mombo jumbo.
That's how it works: 1) A form in a first sub send its fields to TabUserBDinsert() in order to get them into a DB. 2) TabUserBDinsert() check all that fields in the TabUserServerValidar() function before before return the result to TabUserBDinsert(). In that process a table is created to show the errors. 3) if no DB errors found, TabUserRedirect() is call to give user some options. Now, my problem is that I get two pages in user final direction option window: the empty server side table verification of the TabUserServerValidar(), on top of direction table from TabUserRedirect(). Note that TabUserServerValidar() creates a table even if there is no errors found, a empty one. And it shows in the end of the process. How can I make that table disappears? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Canīt close window (code sample) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|