|
Yes Sir this is my .js file coding.
function SelectKey()
{
var msg;
var drp;
var txt;
var txtt;
txt = (((document.getElementById("txtSearch").value) / (document.getElementById("txtSearch").value)) != 1)
txtt = (document.getElementById("txtSearch").value < 0)
drp = (document.getElementById("drpSelect").selectedIndex==3) || (document.getElementById("drpSelect").selectedIndex==4)
if (document.getElementById("drpSelect").selectedIndex==0)
{
msg="Please Select Search Key from Dropdown List!";
}
else if ((document.getElementById("txtSearch").value == "") && (document.getElementById("drpSelect").selectedIndex != 7) && (document.getElementById("drpSelect").selectedIndex != 10))
{
msg="Text Box is Empty!";
}
else if ((drp) && (txt))
{
msg="Invalid Character!";
}
else if ((drp) && (txtt))
{
msg="- Sign Not Allowed Here!";
}
else
{
msg="";
}
if(msg!="")
{
alert(msg);
return false;
}
}
|
|
|
|
|
Hi
Your Javascript looks fine What type of error are you getting in FF ......
Can you post the Error
<l>Thanks and Regards
Sandeep
|
|
|
|
|
the variable query do not get value in FF.
actually query gets value on the selected index selection. but when it is run in FF id doese not get value . Means it s empty.
|
|
|
|
|
Hi
i am trying to solve your problem but i am not finding any loop hole please post your code behind file also today we will solve this problem
<l>Thanks and Regards
Sandeep
|
|
|
|
|
sory sir i was out some where. my code behind file is here
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Try
If (Conn.State <> ConnectionState.Open) Then
Conn.Open()
End If
If drpSelect.SelectedIndex = 1 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and customers.fname like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 2 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and customers.lname like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 3 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.order_id = " & txtSearch.Text & ""
End If
If drpSelect.SelectedIndex = 4 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and customers.customer_id = " & txtSearch.Text & ""
End If
If drpSelect.SelectedIndex = 5 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and customers.zipcode ='" & txtSearch.Text & "'"
End If
If drpSelect.SelectedIndex = 6 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers,biz_cust_extra where customers.customer_id=cust_order.customer_id and customers.customer_id=biz_cust_extra.customer_id and biz_cust_extra.comp_name like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 7 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = 0"
End If
If drpSelect.SelectedIndex = 8 Then
SelectQuery = "SELECT cust_order.order_id as order_id,cutomers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = 0 and customers.fname like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 9 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = 0 and customers.lname like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 10 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = -1"
End If
If drpSelect.SelectedIndex = 11 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = -1 and customers.fname like '%" & txtSearch.Text & "%'"
End If
If drpSelect.SelectedIndex = 12 Then
SelectQuery = "SELECT cust_order.order_id as order_id,customers.fname as fname , customers.lname as lname, cust_order.order_date as order_date,cust_order.order_status as order_status from cust_order,customers where customers.customer_id=cust_order.customer_id and cust_order.trans_status = -1 and customers.lname like '%" & txtSearch.Text & "%'"
End If
selectcommand = New OleDbCommand()
selectcommand2 = New OleDbCommand(SelectQuery, Conn)
total = selectcommand2.ExecuteReader()
If Not total.Read() Then
lblMsg.Visible = True
Else
lblMsg.Visible = False
End If
With selectcommand
.Connection = Conn
.CommandText = SelectQuery
.CommandType = CommandType.Text
End With
adapter = New OleDbDataAdapter
adapter.SelectCommand = selectcommand
dset = New DataSet("quote")
adapter.Fill(dset, "quote")
orderDG.DataSource = dset
orderDG.DataBind()
txtSearch.Text = ""
drpSelect.SelectedIndex = 0
btnBack.Visible = True
totalreclbl.Text = dset.Tables(0).Rows.Count
Catch ex As Exception
Response.Write(ex.ToString)
Finally
Conn.Close()
End Try
End Sub
|
|
|
|
|
Did you Debug it ?
i think Query varaible can't be null only txtSearch.Text would show null ?
What you think ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
What is txtSearch.Text is it Text box or DropDown Control ?
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Sorry i got your requirement
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Sir txtSearch is a textbox where u have to type name , or order no etc. Dropdown list is drpSelect.
|
|
|
|
|
Khan
Its working fine in both IE and FF also
What happened when you click the button ? put a debugger and see whether if statement executes ot not ? Which version are you using 2003 or 2005
And Don't call me sir
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Ok Sandeep,
Can u please give me ur ID so that I can give u password of my page, so u can check it.
if u dont like to post ur id here then please send it to khan_555_777@yahoo.com or if u have id in skype then please add me as arif_bangash.
|
|
|
|
|
Which id are you talking about ?
mail me your code at sakhare@virtusa.com so that i can check but be quick
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Check ur email now and thanks.
|
|
|
|
|
HI Khan
Are you returning true if the Validation are checked
Make one correction in javascript return true if all validations are passed
<l>Thanks and Regards
Sandeep
|
|
|
|
|
Every thing is ok in IE why there is problem in FF.
|
|
|
|
|
Make sure your var/control names are in same case......i faced the same problem and for Firefox amit and Amit are different.
Amit
|
|
|
|
|
hi,
we are developing a software for online transaction. The client gave an API for this.
i want to know, how to instal this certificate & pass queries between two servers.
Regards,
Selva.
|
|
|
|
|
Hi,
I have a dropdown list with "AutoPostBack=true" in my Asp.Net 1.1 page for which i added a client side method for the client event "onchange" using "Attributes.Add". In this client method I am doing some validation. If the validation fails an error message will be shown without causing postback.
This part is work fine with me. If the validation check is OK then I am returning true in client method which causes postback and executes sever side event "OnSelectedIndexChanged" . Now, the problem is that : after the validation check my server side event is not firing up eventhough I placed "return true;" in my client method. Just the postback is not happening
Can any one help me?
Thanks in Advance
Phanindra...
|
|
|
|
|
before return true add following code-
__doPostBack('dropdownlistcontrolname','');
-- modified at 5:31 Tuesday 20th February, 2007
'dropdownlistcontrolname' - is the id of your dropdownlistbox
Nana
|
|
|
|
|
Thank You so much. Its working now.
Thanks a lot
Phanindra...
|
|
|
|
|
Hi guys,
I want to know how to find out session timeout in asp.net 2.0.
Actually i am set timeout attribute in web.config file.
But i didn't find the exact solution. So please send me the answere as soon as possible.
Regards
Senthil.....
|
|
|
|
|
HI
use Session.Timeout property to set the time of session in minutes by default it is 20
<l>Thanks and Regards
Sandeep
|
|
|
|
|
you can set the session timeout period in the IIS .
The default session time out period is 20 minutes.
otherwise you can set it session.timeout="30" in the code behind file.
The value must be in minutes.
try this.
Sathesh Pandian
|
|
|
|
|
Hello, you majestry ALL!
I'm a very new user in ASP.NET and I have an elementary question but I don't know an answer.
I guess nearly all examples work with databases use Nortwind database.
I have VS2005 and MSSQLServer 2005 Express Edition - where I can download this database and how can I correct load that into my SQLServer? (I gues use DATABASE RESTORE but I'm not sure)
Thank you for everthing answers!
--
"Success is simple. Do what's right, the right way, at the right time."
best regards,
tradakad
|
|
|
|