|
in this function i validate textbox value and radio button on button click event
it work in internet explorer very well.
but not work in mozilla firefox what is the reason??
function check(cid)
{
var red=document.getElementById('rd');
var val="PH";
if(rd[0].checked==true)
{
val="KH";
}
var box1 = document.getElementById('txtsearch').value;
box1 = box1.replace(/^\s*|\s*$/g,'');
var box2 = document.getElementById('rd');
if(box2.checked==true)
{
if(box1=="")
{
alert("Please Enter a Keyword, Business or Category");
return false;
}
else
{
window.parent.location.href="../keywordsearch.aspx?kq="+document.getElementById('txtsearch').value+"&stype="+val+"&city="+cid;
}
}
else
{
if(box1.length<6 || box1.length>11 )
{
alert("Please Enter Phone Number(min:6 digit and max:10) ");
return false;
}
else
{ if(IsNumeric(box1))
window.parent.location.href="../keywordsearch.aspx?kq="+document.getElementById('txtsearch').value+"&stype="+val+"&city="+cid;
else
{
alert("Please Enter Only numeric Number ");
return false;
}
}
}
}
html code
/////////////////////////
please send me solution
thanks in advance
no knowledge in .net
|
|
|
|
|
Unknown Ajanabi wrote: if(rd[0].checked==true)
What is "rd" in above code?
I think "rd" is not an object.It must be "red"
please don't forget to vote on the post that helped you.
modified on Saturday, May 24, 2008 3:17 AM
|
|
|
|
|
if(rd[0].checked==true)
What is "rd" in above code?
I think "rd" is not an object.I must be "red"
"rd" is radio button id
no knowledge in .net
|
|
|
|
|
Have you used RadioButtonList control or just RadioButton?
Unknown Ajanabi wrote: if(rd[0].checked==true)
You can not use object ID at this way.
You have to get an object of control.
for example
if(document.getElementById('rd').checked==true)
please don't forget to vote on the post that helped you.
|
|
|
|
|
if(rd[0].checked==true)
You can not use object ID at this way.
You have to get an object of control.
for example
if(document.getElementById('rd').checked==true)
u r write but the check()event not work in mozilla firefox explorer
i wont to know the reason why is it noy work ??
no knowledge in .net
|
|
|
|
|
Hi friends
I have little problem here.
I am creating data tables dynamically.
I want to filter it using sql query string.
Suppose, I have four data tables with the same structure but records may be different.There are two fields ServiceMethod and Rates.
Now I want to filter all tables and want to get match records with the ServiceMethod.
Suppose,four records in First table,three records in other three tables,
and only two records(Service method) are same in all tables.
I want to that two records by filtering all tables and sum of rates and want to add matched records in new table and bind dropdownlist.
Can any guide me how to filter more than one tables using sql query if data tables are created dynamically?
Thanks in advance.
please don't forget to vote on the post that helped you.
|
|
|
|
|
Imran Khan Pathan wrote: Can any guide me how to filter more than one tables using sql query if data tables are created dynamically?
If you have multiple select statements in the query and you filled the results to a DataSet , obviously you will have multiple data tables.
Imran Khan Pathan wrote: Now I want to filter all tables and want to get match records with the ServiceMethod.
You can use Select() method in the DataTable instance to select rows matching to the specified criteria.
|
|
|
|
|
N a v a n e e t h wrote: You can use Select() method in the DataTable instance to select rows matching to the specified criteria.
How can I use select method for more than one tables?
We can use select method to filter just one table.If I have two tables and If I want to get relational data from these two tables,select method can not be useful.Am I right?
Thanks
please don't forget to vote on the post that helped you.
|
|
|
|
|
You are right. Select() can't be used across multiple tables. If all these tables belongs to one DataSet, I think you can use DataRelation to link it. I have not done that before, just a wild guess.
|
|
|
|
|
Currently I am doing this job this way.
I am passing Dataset to DistributeServices Method
Is there any better way?
private int MergeCount = 0;
private void DistributeServices(DataSet dsServiceRates)
{
DataTable dtFinal = new DataTable();
int CountTables = dsServiceRates.Tables.Count;
if (CountTables > 1)
{
for (int i = 0; i < CountTables; i++)
{
if (MergeCount == 0)
{
dtFinal = MergeService(dsServiceRates.Tables[i], dsServiceRates.Tables[i + 1]);
i++;
}
else
{
dtFinal = MergeService(dsServiceRates.Tables[i], dtFinal);
}
}
if (dtFinal.Rows.Count != 0)
{
}
else
{
}
}
else if (CountTables != 0)
{
}
else
{
}
}
private DataTable MergeService(DataTable dTable1, DataTable dTable2)
{
DataTable dtNew = new DataTable();
dtNew.Columns.Add("Method",System.Type.GetType("System.String"));
dtNew.Columns.Add("Rate", System.Type.GetType("System.String"));
foreach (DataRow dRow1 in dTable1.Rows)
{
foreach (DataRow dRow2 in dTable2.Rows)
{
if (dRow1["Method"].ToString() == dRow2["Method"].ToString())
{
MergeCount = 1;
AddRows(dtNew, dRow1["Method"].ToString(), decimal.Parse(dRow1["Rate"].ToString()) + decimal.Parse(dRow2["Rate"].ToString()));
}
}
}
return dtNew;
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
string s = ",22,3,7,8,2,8,";
now I want to check
string has ,22, or not in starting only
,22, should be treated as a string not character.
please help me I need hardly any how
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
You can use StartsWith method of string.
string MyStr=",22,3,7,8,2,8,";
if(s.StartsWith(",22,"))
{
return true;
}
else
{
return false;
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
thanks a lot
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Hi all,
Let me explain in detail what the problem actually is..
I have tried debugging the code starting from page_load, i can retrieve all the values under that event. I'm using a function called update_click which am calling that in listbar_click
Private Sub Update_Click()
Dim strSQL As String = ""
Dim ds As New DataSet
Dim intSlno As Integer
If Trim(txtCode.Value) = "" Then
lblStatus.Text = Item Code Empty"
Exit Sub
End If
end sub
In the above code i can access the value of all the variables but when i try to access the value of Trim(txtCode.Value)it says,
"Cannot evaluate expression because we are stopped in a place where garbage collection is impossible, since the code of the current method may be optimized."
I'm getting this problem only in this function... Can anyone please help me out..
|
|
|
|
|
Hi,
Private Sub Update_Click()
Dim strSQL As String = ""
Dim ds As New DataSet
Dim intSlno As Integer
If Trim(txtCode.Value) == "" Then
lblStatus.Text = Item Code Empty"
Exit Sub
End If
end sub
In the if condition u need to put == inseted of =. because this is condition and not an assignment.
Regards,
RAM
|
|
|
|
|
I dont think the == will work out without error in asp.net
|
|
|
|
|
Hi guys,
We have upgraded to vs2008 and .net framework 3.5. Everything works
perfectly in our development environment. However when we deploy using the
new web deployment project to our testing environment we recieve the
following error when browsing to the website "asp.net client side framework
failed to load".
We have also copied all the code across and receive the same error so it is
not a deployment issue it has something to do with the box. Are there any
special Security settings that we may have missed? The box still runs the 2.0
version of the site fine. We are using IIS6 and we have installed the 3.5
framework on this box.We are using IE7 .
Any suggestions would be appreciated
|
|
|
|
|
I have created all the pages with Master page.i want to clear each page controls using with javascript.how can i write a javascript to clear controls for each page.can anyone can send some code to me.each page clear button onClick Event i want to call this Javascript.
|
|
|
|
|
Ok I am creating an "Inventory" database with a web form where you can edit, delete, and add data. Everythign is working good but I am wondering hwo to do something.
I have these fields for example: Type, Brand, Model, Assigned_To, Serial, Tag_Number.
Now I've created three drop boxes and binded them to Assigned_To, Serial, and Tag_Number (each individually). One is to Assigned_To, one is to Serial, and another is to Tag_Number.
Now.. some people might have multiple products assigned to them.
Like for me example:
Laptop - Jacob Dixon
Blackberry - Jacob Dixon
Now in the drop box Jacob Dixon will appear twice since it binds all the fields from Assigned_To and my name is in there twice..
How would I stop that? I am binding it with visual web developer 2008. Also how can I make it where you cannot enter duplicate numbers in Serial, and Tag_Numbers? Like a message box will pop up and say: That Serial already exist in this database.. same for the Tag_Number
|
|
|
|
|
Can you make the data source for the drop down be a seperate SQL statement ? I thought you could bind the drop down to your list of names ( for example ), assuming your DB kept a list of names which was then indexed to in your main DB. If you have the same name over and over, you could do a select DISTINCT.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Awesome thats great.. It works perfect! How do I make fields in the database not be the same. Like Under the Tag_Number there cannot be duplicate tags.. if there is, someone messed up.. How do I assign that? Through my dataset? If so how do I make it where it won't throw an error if that does happen and instead erase it and show a message box saying there is already another tag number
|
|
|
|
|
When you enter a value, there's a callback, you can do validation there, if a client side validator won't do it
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
is it possible to display one(!!) UpdateProgress for every updatePanel on a page except specyfic one?!
i've got one that has a timer control on, and it causes UpdateProgress to show.
life is study!!!
|
|
|
|
|
I have controls on a page (a combobox with autopostback and a button).
When I click one, the page loads, then does the trigger.
ie. Change the combobox selection, the page just refreshes. The trigger updates variables then does nothing. The next time I change the selection, the changed variables are processed in the Load, but it's too late, AND my selection is different now, so those variables are not correct.
The button click causes Load, then the trigger, with the same back-assward behaviour.
I need the opposite to happen, since the trigger code affects what will be displayed in the Load.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
I Just noticed those controls are in Panels.
If I add a control outside a Panel (on the bare page), it triggers normally.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|