Jump to content

Siddhesh

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by Siddhesh

  1. I Think what u have done is framing and not table columns.If u want to see data in the frames then create table/div/P in 'menu.html' and 'index.html'.if u have done that then pls post that code
  2. Try this Change the function as Sub Fillcombo (TableName, name, value)SQL= "SELECT " & name & " , "& value &" FROM " & (TableName)rs.Open SQL, conn If Not rs.EOF Then Do While Not rs.EOF %> <Option value=<%= rs("value")%>><%= rs("name")%></Option> <% rs.MoveNext LoopEnd Ifrs.CloseEnd Sub Then in ur form use the following <P><Select Name="Drd1" OnChange=" Fn_Drd_Change('Drd1','Txt1')"><% Call Fillcombo("BAKERYandCAKES", "name") %></Select><INPUT Name="Txt1" Value=""></P>.. Please use different name for all dropdowns and text boxesnow right a function in javascript function Fn_Drd_Change(Combo, Text){ eval("document.forms(0)."+ Text +".value = document.forms(0)."+ Combo +".value");} I didn't try it but will work
  3. I dont know about php but it might be same as aspSo i m giving solution as per ASP, hope it will workMove your query to other page say "Delete.php"and on the clik of "DELETE" call this page.<a href="Delete.php">Delete</a><?phpinclude "connect.php";$querydel = "ALTER TABLE `upmatch` DROP `qsd`";$sqldel = mysql_query($querydel) or die ( mysql_error( ) );'''''' Here redirect this page to previous page?>
  4. Please post your code so that we can find the error if present
  5. check the following linkhttp://www.w3schools.com/html/html_eventattributes.asp
  6. Siddhesh

    error checking

    As you mentioned one way is using rs.EOFthe other way is by using recordcounti.e.if rs.RecordCount = 0 Then Response.Write " No Record Present" End If
  7. You can get data from more than one table at a time but with one single query only. like "select a, b, c from Tbl1 d, Tbl2 e where d.field1 = e.field1"But i think this is not ur requirment.If you want to get data from different tables one for each dropdownthen better use different querries <%Sub Fill combo (TableName, FieldName) SQL = "SELECT DISTINCT FieldName FROM TableName" CmdPopulateStates.Open SQL, DataConn If Not CmdPopulateStates.EOF Then Do While Not CmdPopulateStates.EOF %> <Option value=<%=CmdPopulateStates("FieldName")%>><%=CmdPopulateStates("FieldName")%></Option> <% CmdPopulateStates.MoveNext Loop End IfCmdPopulateStates.CloseEnd Sub%> and from html page you can call this Procedure where u want to create dropdown <Select Name="Drd1"> <% Call Fill combo TableName1, FieldName2 %> </Select> <Select Name="Drd2"> <% Call Fill combo TableName2, FieldName2 %> </Select>
  8. Siddhesh

    error checking

    So what is the problem??Is this code not working or you are gettting some another error??the code is looking fineu can also use as if rs.EOF then Response.write "Error" Response.End end if
  9. I could not get your purpose, But the error is because of the statementsSET @find = (select sEmployeeID from tblPREE);SET @repl = (select sEmployeeIDf from tblPREE);as the query is returning more than 1 values which cannot be assigned to a variable. So use such query which will return only 1 value
  10. Create Dropdown as<Select Name="Drd1"> <Option Value="0">Select </Option> <Option Value="1">Item 1</Option> <Option Value="2">Item 2</Option> <Option Value="3">Item 3</Option></Select>then in the script u can checkif((form.Drd1.value == form.Drd2.value) && (form.Drd1.value != 0)){ alert('you can't select same');}
  11. Ok try this This will show you the querry in hte browser.Copy this querry and run it from backend(i.e. Querry analyser etc)Is it updating the record??
  12. I m bit confused with the commented part and Red part in the code.Please Post Code with no Comments and Red statemets.it is interesting, because I m not facing any problem with the same code.
  13. Hi,Make a string in asp which contains data from the DB,then pass this string to Marquee<% Dim Str_Scroll Do While Not RS.EOF Str_Scroll = Str_Scroll &"...."& RS.Fields(0) RS.MoveNext Loop%><Marquee><%=Str_Scroll%></Marquee>
  14. Siddhesh

    Validatr

    Ok, thats Fine.Now let me ask it in wide manner.I have 4 Textboxes and 2 Buttons(Save,Search).All the textboxes are having requiredfield validator.My requirement is that Only Two validators should work onclick of Save button.And other validator should work onclick of Search button.Thanks for help.
  15. I think there some slip of mindplease check the SQL String for Update sql="UPDATE tblCustomer SET CustomerID="' & Request.Form("CustomerID") & "'," sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' " WHERE tblCustomer.[CustomerID]=" & CustomerID " Just Change the last line WHERE tblCustomer.[CustomerID]=" & CustomerID "By sql=sql & " WHERE tblCustomer.[CustomerID]=" & CustomerIDThats it. i think this ll solve the problem
  16. So You want whole code!!!Sorry boss, But I think you should click on following link for basic understanding http://www.w3schools.com/js/default.asp
  17. You can use some special characters as seperator between two values. Like double Pipe / Comma / !! And then on the target page you can split the variable and use it
  18. Siddhesh

    Validatr

    Hi,I Have 2 Text Box And 2 Buttons(Save, Search).Now if I click on Save Button Then Requirefieldvalidator for both the Text Boxes shoould work, but when I click on Search button validator for the text fields should not work.Is it Possible??It can be done using javascript, but can we do it only with .NETI m using ASP.NET with language VB
  19. Thanks for taking efforts for my problem.I m still searching for the solution
  20. Sorry for the mistakeHere is the code <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Home_Page.aspx.vb" Inherits="Test_Sid.WebForm1"%><HTML> <HEAD> </HEAD> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> <TABLE height="492" cellSpacing="0" cellPadding="0" width="856" border="0" ms_2d_layout="TRUE"> <TR vAlign="top"> <TD > <asp:DataGrid id="DataGrid1" runat="server" Width="700px" AutoGenerateColumns="False" PageSize="10" PagerStyle-Mode="NumericPages" AllowPaging="True"> <Columns> <asp:TemplateColumn HeaderText="Select"> <HeaderStyle Width="20%"></HeaderStyle> <ItemTemplate> <asp:RadioButton GroupName="Rdo1" ID="Rd"></asp:RadioButton> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="ContactName" HeaderText="Name"> <HeaderStyle Width="20%"></HeaderStyle> </asp:BoundColumn> <asp:BoundColumn DataField="City" HeaderText="City"> <HeaderStyle Width="20%"></HeaderStyle> </asp:BoundColumn> <asp:HyperLinkColumn Text="Go to search Engine" Target="_blank" DataNavigateUrlField="City" DataNavigateUrlFormatString="http://Google.com/search?hl=en&lr=&q={0}" HeaderText="Search"> <HeaderStyle Width="20%"></HeaderStyle> <ItemStyle Wrap="False"></ItemStyle> </asp:HyperLinkColumn> <asp:ButtonColumn Text="Click Me" ButtonType="PushButton" HeaderText="<B>Button</B>"></asp:ButtonColumn> </Columns> <PagerStyle Mode="NumericPages"></PagerStyle> </asp:DataGrid></TD> </TR> </TABLE> </form> </body></HTML> And the code is as follows Public Class WebForm1 Inherits System.Web.UI.Page#Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub#End Region Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here BindGrid() End Sub Private Sub BindGrid() Dim SDA As SqlClient.SqlDataAdapter Dim DS As New Data.DataSet Dim StrSqlQry As New SqlClient.SqlCommand("Select * From Customers", Session("con")) Session("con").Open() SDA = New SqlClient.SqlDataAdapter(StrSqlQry) SDA.Fill(DS, "Customers") DataGrid1.DataSource = DS.Tables("Customers") DataGrid1.DataBind() Session("con").Close() End Sub The Connection string is as follows The problem is that I want to select only one row of the grid for which i have to checked radio button, and if I click on the other radio button then 1st should get deselect. But currently i can select any number of radio buttons. So now I want to group them. I tried with with group name, but it is not working.
  21. Hi, I m trying to fill a datagrid with Some values from DB. Now first colomn is a raio button and u can select only one of them.But the thing is not happening.Can anyone tell me solution (without using any third party component)My Grid is as shown below. <asp:DataGrid id="DataGrid1" runat="server" Width="700px" AutoGenerateColumns="False" PageSize="10" PagerStyle-Mode="NumericPages" AllowPaging="True"> <Columns> <asp:TemplateColumn HeaderText="Select"> <HeaderStyle Width="20%"></HeaderStyle> <ItemTemplate> <asp:RadioButton GroupName="Rdo1" ID="Rd"></asp:RadioButton> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="ContactName" HeaderText="Name"> <HeaderStyle Width="20%"></HeaderStyle> </asp:BoundColumn> <asp:BoundColumn DataField="City" HeaderText="City"> <HeaderStyle Width="20%"></HeaderStyle> </asp:BoundColumn> <asp:HyperLinkColumn Text="Go to search Engine" Target="_blank" DataNavigateUrlField="City" DataNavigateUrlFormatString="http://Google.com/search?hl=en&lr=&q={0}" HeaderText="Search"> <HeaderStyle Width="20%"></HeaderStyle> <ItemStyle Wrap="False"></ItemStyle> </asp:HyperLinkColumn> <asp:ButtonColumn Text="Click Me" ButtonType="PushButton" HeaderText="<B>Button</B>"></asp:ButtonColumn> </Columns> <PagerStyle Mode="NumericPages"></PagerStyle></asp:DataGrid></TD>
  22. Siddhesh

    HTA question

    I dont think this can be done using HTA
  23. Hi, I m posting some code according to ur requirement.As your page is in asp, the thing can be done in another way like just submit the form after every Onchange event of every dropdown.But as u want it in javascript, I think this may help you<HTML> <HEAD> <script> var Arr = new Array(14) var TotalDrd; for(i=0;i<=13;i++) { Arr[i] = new Array(2); } Arr[0][0] = 2.83; Arr[1][0] = 6.31; Arr[2][0] = 5.02; Arr[3][0] = 3.94; Arr[4][0] = 4.92; Arr[5][0] = 4.94; Arr[6][0] = 5.46; Arr[7][0] = 4.76; Arr[8][0] = 3.60; Arr[9][0] = 3.81; Arr[10][0] = 4.35; Arr[11][0] = 2.97; Arr[12][0] = 3.88; Arr[13][0] = 3.07; Arr[0][1] = "Duffy"; Arr[1][1] = "Bay"; Arr[2][1] = "Buenits"; Arr[3][1] = "Casey"; Arr[4][1] = "Castillo"; Arr[5][1] = "Cota"; Arr[6][1] = "Doumit"; Arr[7][1] = "Eldred"; Arr[8][1] = "Gerut"; Arr[9][1] = "McLouth" Arr[10][1] = "Randa"; Arr[11][1] = "Sanchez"; Arr[12][1] = "CWilson"; Arr[13][1] = "JWilson"; function Lock(val) { var drd1, drd2, drd3, drd4, drd5, drd6, drd7, drd8; var SelectedDrd; var counter; var j = 0; TotalDrd = document.getElementsByTagName("Select").length; Selected_Drd_Value = eval("document.Form1."+ val +".value"); drd1 = document.Form1.Drd1.value; drd2 = document.Form1.Drd2.value; drd3 = document.Form1.Drd3.value; drd4 = document.Form1.Drd4.value; drd5 = document.Form1.Drd5.value; drd6 = document.Form1.Drd6.value; drd7 = document.Form1.Drd7.value; drd8 = document.Form1.Drd8.value; for(counter=0; counter<TotalDrd; counter++) { SelectedDrd = document.getElementsByTagName("Select").item(counter).id; eval("TextSel = document.Form1."+ SelectedDrd +".options[document.Form1."+ SelectedDrd +".selectedIndex].text"); eval("ValSel = document.Form1."+ SelectedDrd +".value"); eval("document.Form1."+ SelectedDrd +".length = 0"); eval("document.Form1."+ SelectedDrd +".length = document.Form1."+ SelectedDrd +".length + 1"); eval("document.Form1."+ SelectedDrd +".options[0].text = TextSel"); eval("document.Form1."+ SelectedDrd +".options[0].value = ValSel"); j = 1; for(i=0;i<=13;i++) { if((Arr[i][0] != drd1) && (Arr[i][0] != drd2) && (Arr[i][0] != drd3) && (Arr[i][0] != drd4) && (Arr[i][0] != drd5) && (Arr[i][0] != drd6) && (Arr[i][0] != drd7) && (Arr[i][0] != drd8)) { eval("document.Form1."+ SelectedDrd +".length = document.Form1."+ SelectedDrd +".length + 1"); eval("document.Form1."+ SelectedDrd +".options[j].text = Arr[i][1]"); eval("document.Form1."+ SelectedDrd +".options[j].value = Arr[i][0]"); j++; } } } Fn_CheckTotal(); } function Fn_CheckTotal() { var Total= 0; var All_Select = "Y"; for(i=0;i<TotalDrd;i++) { eval("if(document.getElementsByTagName('Select').item("+ i +").value == 0){ All_Select = 'N' }"); } if(All_Select == "Y") { for(i=0;i<TotalDrd;i++) { Total = parseFloat(Total) + parseFloat(eval("document.getElementsByTagName('Select').item("+ i +").value")); } Total = (parseFloat(Total) / 8) * 162; document.Form1.Total.value = Total; } } </SCRIPT> </HEAD> <BODY bgcolor="#000000"> <form Name="Form1" method="POST" action="test.asp"> <select id="Drd1" onChange="Lock(this.id)" size="1" name="Drd1"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd2" onChange="Lock(this.id)" size="1" name="Drd2"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd3" onChange="Lock(this.id)" size="1" name="Drd3"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd4" onChange="Lock(this.id)" size="1" name="Drd4"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd5" onChange="Lock(this.id)" size="1" name="Drd5"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd6" onChange="Lock(this.id)" size="1" name="Drd6"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd7" onChange="Lock(this.id)" size="1" name="Drd7"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <select id="Drd8" onChange="Lock(this.id)" size="1" name="Drd8"> <option value=0>Choose One</option> <option value=2.83>Duffy</option> <option value=6.31>Bay</option> <option value=5.02>Burnitz</option> <option value=3.94>Casey</option> <option value=4.92>Castillo</option> <option value=4.94>Cota</option> <option value=5.46>Doumit</option> <option value=4.76>Eldred</option> <option value=3.60>Gerut</option> <option value=3.81>McLouth</option> <option value=4.35>Randa</option> <option value=2.97>Sanchez</option> <option value=3,88>CWilson</option> <option value=3.07>JWilson</option> </select> <Input Type="Text" Name="Total" Value=""> </form> </BODY></HTML> Please give reply, is it working or not??
  24. Siddhesh

    Drop down box

    Just try the following in the first pageReplace <select id="Select"> By <select id="Select" Name="Select">This may solve the problem
×
×
  • Create New...