When change the <script language="javas cript"> to <script type="text/javascript">, javascript function now works no more. Previously it was working. Javascript function is given below - - function log1()
-
{
-
window.location="log1.asp"
-
}
-
function page1()
-
{
-
window.location="page1.asp"
-
}
and place where calling this function are below - - <font style="position:absolute;left:300; top:400">
-
<input type="button" style="width:100px" value="Login" onclick="log1()">
-
</font>
-
<font style="position:absolute;left:300; top:450">
-
<input type="button" style="width:100px" value="Back" onclick="page1()">
-
</font>
Where is the problem?
Thanks and regards,
Vikas
13 1934 acoder 16,027
Recognized Expert Moderator MVP
Try using window.location .href.
Just a note: there's no need to use font tags. Replace them with div tags.
I changed the code as follows - - function log1()
-
{
-
window.location.href="log1.asp"
-
}
-
-
Still it is not working.
Should I not use <font> tag for placing text in browser? Is there any difference between <font> and <div> for placing text?
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
Show the rest of your code.
Should I not use <font> tag for placing text in browser? Is there any difference between <font> and <div> for placing text?
The font tag is deprecated. You should use CSS for styling. Here you're not placing text within the font tags, you were just displaying buttons.
This is my complete code. - <%
-
Set CON1 = Server.CreateObject("ADODB.Connection")
-
con1.open "Provider=MSDAORA.1;dsn=ops1;Password=gis;User ID=gis;Data Source=alpha2;Persist Security Info=True"
-
SET RS1=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
Set CON = Server.CreateObject("ADODB.Connection")
-
con.open "Provider=MSDAORA.1;dsn=ops;Password=op;User ID=outpass;Data Source=intradb;Persist Security Info=True"
-
SET RS=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
SET RS2=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
SET RS3=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
SET RS4=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
SET RS5=SERVER.CREATEOBJECT("ADODB.RECORDSET")
-
-
ddd=DAY(DATE)
-
mm=month(DATE)
-
mmm=monthname(mm)
-
yyy=year(DATE)
-
if session("emp_no") = "" then
-
%>
-
<h2><font style="position:absolute;left:250;top:250">Session has been expired. Re-login please.</font></h2>
-
<div style="position:absolute;left:300; top:400">
-
<input type="button" style="width:100px" value="Login" onclick="log1()">
-
</div>
-
<div style="position:absolute;left:550; top:400">
-
<input type="button" style="width:100px" value="Exit" onclick="window.close();">
-
</div>
-
<%else%>
-
<body onload="document.myform.per_name.focus();" text=#000000 vLink=#330066 aLink=#666666 link=#000000 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
-
<form name="myform" action="material.asp" method="post" onsubmit="return validate_form()" >
-
<table cellSpacing="0" cellPadding="0" width="780" height="500" border="0">
-
<tr>
-
<td vAlign="top" align="right" width="180" height="500"></td>
-
<td vAlign="top" align="left" width="600" bgColor="#ffffff">
-
<table cellSpacing="4" cellPadding="1" border="0" width="600" height="500" border="0">
-
<tbody bgcolor="cyan">
-
<tr>
-
<td colSpan="2">
-
<font face="Arial, Helvetica, sans-serif" color="#330066" size="2">
-
<center><h2><b>Preparation of Material Outpass</b></h2></center>
-
</font>
-
</td>
-
</tr>
-
<tr>
-
<td colSpan="2"><font face="Arial, Helvetica, sans-serif" size="2"><b>*</b>Indicates mandatory fields</FONT></TD>
-
</tr>
-
<%
-
set rs4=CON.EXECUTE("SELECT MAX(GP_NO) FROM GPS")
-
GPNO=CDBL(RS4(0))+1
-
%>
-
<tr>
-
<td><font style="width:225" face="Arial, Helvetica, sans-serif" size="2"><b>*Gatepass Number</b></font></td>
-
<td>
-
<font face="Arial, Helvetica, sans-serif" size="2"><%response.write GPNO%>
-
<input type="hidden" size="30" name="gno" value=<%=gpno%>>
-
</font>
-
</td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>*Name of the person taking the <br>  material out</b></font></td>
-
<td>
-
<font face="Arial, Helvetica, sans-serif" size="2">
-
<input type="text" size="30" name="per_name" onblur="checkpn(this)">
-
</font>
-
</td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>*Transaction Type</b></font></td>
-
<td>
-
<select size="1" name="trans_type">
-
<option value="RE" selected>Returnable</option>
-
<option value="NR">Not Returnable</option>
-
</select>
-
</td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>*Issue Date</b></font></td>
-
<td><script>DateInput('issue_dt', true, 'DD/MM/YYYY')</script></td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>  Expected Return Date</b></font></td>
-
<td><script>DateInput('exp_ret_dt', true, 'DD/MM/YYYY')</script></td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>*Department </b></font></td>
-
<td>
-
<%
-
dim v_sectcd
-
dim v_sectname
-
set rs = con.execute("select dept from emp where emp_no = '" & session("emp_no")&"'")
-
rs.movefirst
-
v_sectcd = RS("dept")
-
%>
-
<font face="Arial, Helvetica, sans-serif" size="2">
-
<select name="dept">
-
<%
-
set rs1 = con1.execute("select sectcode, sect_des from fms.br_sec_mas_akd ")
-
rs1.movefirst
-
do while not rs1.eof
-
if cint(v_sectcd) = cint(rs1("sectcode")) then
-
%>
-
<option value selected="<%=rs1("sectcode")%>"><%=rs1("sect_des")%></option>
-
<% else%>
-
<option Value="<%=rs1("sectcode")%>"><%=rs1("sect_des")%></option>
-
<%
-
end if
-
rs1.movenext
-
loop
-
%>
-
</select>
-
</font>
-
</td>
-
</tr>
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif" size="2"><b>*Firm Name </b></font></td>
-
<td>
-
<font face="Arial, Helvetica, sans-serif" size="2">
-
<SELECT NAME="FIRM_NAME">
-
<%
-
Set RS = CON.EXECUTE("SELECT Firm_name FROM firm ")
-
Do While Not RS.EOF
-
%>
-
<option Value="<%=RS("firm_name")%>"><%=RS("FIRM_NAME")%></option>
-
<%
-
RS.MoveNext
-
Loop
-
%>
-
</SELECT>
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><b> Vehicle No.</b></FONT></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT size="10" name="vech_no" value="N/A" onblur="check_vech_no(this)">
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><B> Driver Name </B></FONT></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT size="30" name="drv_name" value="N/A" onblur="checkdrn(this)">
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><B> Purpose</B></FONT></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT size="30" name="purpose" value="N/A" onblur="checkpurpose(this)">
-
</FONT>
-
</TD>
-
</TR>
-
- <%
-
EMPNO=SESSION("EMP_NO")
-
SET RS2=CON1.EXECUTE("SELECT C.DEPTCODE FROM M_FIX_EMPLOYEE A, BR_DEP_MAS_AKD B, BR_SEC_MAS_AKD C WHERE A.DEPT_CD=C.SECTCODE AND B.DEPTCODE=C.DEPTCODE AND A.EMPNO ='"& EMPNO &"'")
-
DEPT=RS2(0)
-
SET RS3=CON.EXECUTE("SELECT EMP_NO FROM EMP WHERE DEPT='"& DEPT &"' AND OPLEVEL='A' ")
-
%>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><b>*Authorised By</b>(Employee No.)</FONT></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<SELECT NAME="IAE">
-
<%
-
Do While Not RS3.EOF
-
SET RS5=CON1.EXECUTE("SELECT name FROM M_FIX_EMPLOYEE WHERE EMPNO ='"& rs3(0) &"'")
-
%>
-
<option Value="<%=RS3(0)%>"><%=RS3(0)&"-"&rs5(0)%></option>
-
<%
-
RS3.MoveNext
-
Loop
-
%>
-
</SELECT>
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><b>*Prepared By </b>(Employee No.)</FONT></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT size="10" name="pepd_by" readonly value=<%=session("emp_no")%>>
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><b>*Recieved By </b></font></TD>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT size="10" name="recv_by" onblur="checkrecv(this)">
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<TD><FONT face="Arial, Helvetica, sans-serif" size="2"><b> Remarks </b></font></td>
-
<TD>
-
<FONT face="Arial, Helvetica, sans-serif" size="2">
-
<INPUT type="text" size="30" name="rem" value="N/A">
-
</FONT>
-
</TD>
-
</TR>
-
<TR>
-
<td align="center" colSpan="3">
-
<input type="button" style="width:100px" value="Back" name="back" onclick="page1()">
-
<input type="reset" style="width:100px" value="Clear" name="clear">
-
<input type="submit" style="width:100px" value="Submit" name="submit">
-
</td>
-
</TR>
-
</TBODY>
-
</TABLE>
-
</TD>
-
</tr>
-
</TABLE>
-
</FORM><!--END MAIN FORM TABLE-->
-
</BODY>
-
<%end if%>
-
</HTML>
-
-
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
If I've understood correctly from your ASP code, if the session variable is not set, only the following code is displayed in the browser (after the script tags):
[html]<h2><font style="position :absolute;left: 250;top:250">Se ssion has been expired. Re-login please.</font></h2>
<div style="position :absolute;left: 300; top:400">
<input type="button" style="width:10 0px" value="Login" onclick="log1() ">
</div>
<div style="position :absolute;left: 550; top:400">
<input type="button" style="width:10 0px" value="Exit" onclick="window .close();">
</div> [/html]Is that correct?
Yes Sir, It is correct.
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
In which case, your code would look like this:
If you check the error console, there are errors in the validate_form() function. There's an extra bracket and break; is not needed.
Oh I am very sorry for my carelessness sir.
You are right sir.
Now it is working. I have to very utmost carefull while code in big programme.
Thanks and regards,
Vikas
acoder 16,027
Recognized Expert Moderator MVP
I would add one more thing: validate your markup using the W3C validator. At the moment, it's horribly invalid. Also, add a doctype to the top of your pages.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Ville Vainio |
last post by:
I don't know if you have seen this before, but here goes:
http://text.userlinux.com/white_paper.html
There is a jab at Python, though, mentioning that Ruby is more
"refined".
--
Ville Vainio http://www.students.tut.fi/~vainio24
|
by: Web Developer |
last post by:
Hi,
I come across the term "type checking" very often in my readings on C++, and
have never heard it in Java. Besides the simplistic answer that it checks
the "type", what more does it mean?
WD
|
by: Dave |
last post by:
Hi all,
I was trying to make an image submit button with a rollover and discovered
to my suprise that there is no way to access a form element of the "image"
type. I tried specifying it by name and also by the elements array with
no luck.
Even weirder, I can sandwich an image button in between other input types
and then write a script diplaying the contents of the elements array and it
acts as if the image button does not exist at all!...
|
by: David D. |
last post by:
Does the file extension matter when including a JavaScript file in an HTML
page?
Normally, one would include a JavaScript file in an HTML page using
<script src="foo.JS" type="text/javascript">
However, I have found that I can use an alternate file extension, such as
<script src="foo.HTML" type="text/javascript">
It works fine with my IE 6 and Mozilla. Will it work with other browsers?
|
by: David Cameron |
last post by:
I noticed
that using an HTMLInputRadioButton and specifying a value to be an empty
string (""), this is overridden by ASP.Net which set the value of the
control to be the same as the ID of the control.
See the code below
* Page.aspx:
<%@ Page language="c#" Codebehind="Test.aspx.cs" AutoEventWireup="false"
Inherits="Webspace.Test" %>
| |
by: RFS666 |
last post by:
Hello,
I would like to use variables with a type in jscript.NET.
I declare them as follows:
var x : double = 5.03;
This doesn't work in my script, that I write to the page in codebehind with
"registerClientScriptBlock" as follows:
string script = "<script language=jscript>";
script += "function test()";
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic paper written on this
subject.
On the Expressive Power of Programming Languages, by Matthias
Felleisen, 1990.
http://www.ccs.neu.edu/home/cobbe/pl-seminar-jr/notes/2003-sep-26/expressive-slides.pdf
|
by: Steve |
last post by:
Hi;
I've being going through some legacy code on an old JSP site I have
been patching. I noticed that when I save the JSP down to my PC as an
HTML file I get this javascript error in IE 6 ( not in the latest
Firefox ):
"invalid character"
The problem traces back to this line of code:
|
by: howa |
last post by:
Just found a funny things..
in HTML4's dtd, http://www.w3.org/TR/html4/strict.dtd
language is not valid, i.e.
<!ELEMENT SCRIPT - - %Script; -- script statements -->
<!ATTLIST SCRIPT
charset %Charset; #IMPLIED -- char encoding of linked
resource --
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |