473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

y is it not workin

could u plz help me in solving this problem.y the following is not
working
<script language="javascript">
function btnClear()
{
document.Loc_Emp.T1.value="";
document.Loc_Emp.T2.value="";
document.Loc_Emp.T3.Value="";
}
function btnSearch()
{

if(document.Loc_Emp.T1.value==" " &&
document.Loc_Emp.T2.value==" " && document.Loc_Emp.T3.value==" ")
{
alert("Please enter any one value");
}
else
{
document.Loc_Emp.submit();}
}

</script>

Feb 28 '06 #1
5 1133
thejes john wrote:
function btnSearch() {
if(document.Loc_Emp.T1.value==" " && document.Loc_Emp.T2.value==" " && document.Loc_Emp.T3.value==" "){
alert("Please enter any one value");
}
else {
document.Loc_Emp.submit();
}
}


You didn't said what isn't working, the error, etc. So I guess your
problem is just in the above piece of code, where you should replace " "
by "" =b

Anyway, this approach is bad, you must have a good reason to call
"form.submit" inside JavaScript.

ps: Don't use short words on a global newsgroup, I'm not american for
example ;]
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
Feb 28 '06 #2
thejes john wrote:
could u plz help me in solving this problem.y the following is not
working

Can you ask the question again in something other than txt gobbledegook?

--
Ian Collins.
Feb 28 '06 #3
thejes john wrote:
could u plz help me in solving this problem.
In case this is a question (I do not see a question mark, though):
Who is "u", and is he/she subscribed to this newsgroup?
y the following is not working
[...]
alert("Please enter any one value");

^
The "y" is working fine here. Your problem must be elsewhere.
SCNR

PointedEars
Feb 28 '06 #4
"thejes john" <th********@yahoo.co.in> writes:
could u plz help me in solving this problem.y the following is not
working
To fix a problem, we must be able to
1) reproduce,
2) recognize, and
3) repair it.

For 1) we need to have the entire page that fails (I prefer a link to the
live page), or better yet, a small self-contained example that exhibits
the problem. For 2) you must say what the problem is, and "not working"
is not it. How does what happens differ from what you wanted?
For 3) we must also know what you did want to happen.

Without that, the best we can do is guess.
<script language="javascript">
function btnClear()
{
document.Loc_Emp.T1.value="";
The recommended way to access a form control is through the forms
collection, i.e.,
document.forms['Loc_Emp'].elements['T1'].value = "";
That's unlikely to be a problem though.
document.Loc_Emp.T2.value="";
document.Loc_Emp.T3.Value="";
}
function btnSearch()
{

if(document.Loc_Emp.T1.value==" " &&
document.Loc_Emp.T2.value==" " && document.Loc_Emp.T3.value==" ")
This looks like an attempt at checking that something has been entered
into at least one of three form controls. You probably mean to compare
to "" (the empty string, and the initial value of a text form control if
no value was provided) and not " ", the string containing a single space.
{
alert("Please enter any one value");
}
else
{
document.Loc_Emp.submit();}
}


This submission is better performed by the form itself. If you return
false from the error branch, after the alert, you can call the test
function as:

<form action="..." onsubmit="return btnSearch(this);">

(I pass the form as a parameter, making it even easier to access the
controls from inside the function).
Regards
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Feb 28 '06 #5
thank you so much for the detailed explanation.this is the first time
im sending a query in net.

Mar 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: J. Hall | last post by:
Hi guys, Witten a function to check two input boxes, ensure that only one has a numerical value in, but I'm gettng the javascript error 'Object expected'?? function...
5
by: worzel | last post by:
How do I have my win forms app find my configuration file. I want to have this conf file stored in the same folder as the exectuable and simply refer to it using a relative path. All seemed good...
1
by: Indepth | last post by:
Overview: We're creating a ASP.NET app in C# that calls some C# programs we've created. Our DB server is on a w2k3 machine and using our w2k machines as our web server. Without setting an Identity...
3
by: dan_andrews | last post by:
<?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" > <html xmlns="http://www.w3.org/1999/xhtml">...
9
by: Scirious | last post by:
People, I want to do same things with a progress bar but I don't know how. So, how do I change it to make it a solid bar, not a step byt step as the default? And how do I make it a vertical bar?...
3
by: splintercell | last post by:
well i got this code from java.sun.com and tried modiifying it in all the possible ways,but to no good.. stil its not workin..pleas help me out and try postin good workinw web cralwer if u have.....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.