Search Results

Search found 3785 results on 152 pages for 'jun li'.

Page 37/152 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Trying to Add Insert Row to Footer in GridView ASP.net

    - by chillconsulting
    I'm trying to give the user the ability to create a new record from the footer row and my event handler doesn't seem to be working... or maybe I'm going at this all wrong. The insert button that I enabled in the gridview doesn't work either...checkout the site at http://aisched.engr.oregonstate.edu/admin/courses.aspx Here is my code in front and behind: public partial class admin_courses : System.Web.UI.Page { public Table table; ListDictionary listValues = new ListDictionary(); TextBox textBox1 = new TextBox(); //Name TextBox textBox2 = new TextBox(); //CR TextBox textBox3 = new TextBox(); //CourseNum TextBox textBox4 = new TextBox(); //Dept protected void Page_Init() { } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.Footer) return; //Escape if not footer textBox1.ID = "name"; textBox1.Width = 250; textBox2.ID = "credit_hours"; textBox2.Width = 25; textBox3.ID = "dept"; textBox3.Width = 30; textBox4.ID = "class"; textBox4.Width = 25; LinkButton add = new LinkButton(); add.ID = "add"; add.Text = "Add course"; add.CommandName = "add"; add.Click += new EventHandler(add_Click); e.Row.Cells[1].Controls.Add(textBox1); e.Row.Cells[2].Controls.Add(textBox2); e.Row.Cells[3].Controls.Add(textBox3); e.Row.Cells[4].Controls.Add(textBox4); e.Row.Cells[5].Controls.Add(add); } public void add_Click(object sender, EventArgs e) { Response.Write("you Clicked Add Course!"); if (textBox1.Text != null && textBox2.Text != null && textBox3.Text != null && textBox4.Text != null) { listValues.Add("name", textBox1.Text); listValues.Add("credit_hours", textBox2.Text); listValues.Add("dept", textBox4.Text); //For Visual listValues.Add("class", textBox3.Text); } LinqDataSource1.Insert(listValues); Response.Redirect("~/admin/courses.aspx"); } } <%@ Page Language="C#" MasterPageFile="~/admin.master" AutoEventWireup="true" CodeFile="courses.aspx.cs" Inherits="admin_courses" Title="OSU Aisched | Admin - Courses" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <asp:Content ID="Content1" ContentPlaceHolderID="admin_nav_links" Runat="Server"> <ul id="main"> <li><a href="overview.aspx">Overview</a></li> <li><a href="users.aspx">Users</a></li> <li class="current_page_item"><a href="courses.aspx">Courses</a></li> <li><a href="programs.aspx">Programs</a></li> <li><a href="sections.aspx">Sections</a></li> <li><a href="import.aspx">Import</a></li> <li><a href="logs.aspx">Logs</a></li> </ul> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form id="Form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="courses"> </asp:LinqDataSource> <h1><a>Courses</a></h1> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> </asp:UpdateProgress> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="course_id" DataSourceID="LinqDataSource1" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AllowSorting="True" ShowFooter="True" OnRowDataBound="GridView1_RowDataBound" > <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" /> <Columns> <asp:BoundField DataField="course_id" HeaderText="ID" ReadOnly="True" SortExpression="course_id" /> <asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" /> <asp:BoundField DataField="credit_hours" HeaderText="CR" SortExpression="credit_hours" /> <asp:BoundField DataField="dept" HeaderText="Dept" SortExpression="dept" /> <asp:BoundField DataField="class" HeaderText="#" SortExpression="class" /> <asp:CommandField DeleteImageUrl="~/media/delete.png" ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True"/> </Columns> <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" /> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> </asp:GridView> <br /> <asp:HyperLink ID="HyperLink1" runat="server" Target="~/admin/addCourse.aspx" Enabled="true"NavigateUrl="~/admin/addCourse.aspx" Text="Add New course"></asp:HyperLink> <br /> </form> </asp:Content>

    Read the article

  • jquery ui.sortable with tooltips

    - by FFish
    On a page I have a sortable list with thumbnails. When rolling over the images I wanted a tooltip to show a bigger image. I found qTip, but maybe there is something better / easier? How can I connect the imgPath var from the sortable to the qtip? var imgPath = '<img src="002171/imm/001.jpg" />'; $("#sortable").sortable(); $("#sortable").disableSelection(); $('#sortable li img').qtip({ content: { text: imgPath } }); <div id="demo"> <ul id="sortable"> <li><img src="002171/tn/001.jpg" /></li> <li><img src="002171/tn/002.jpg" /></li> <li><img src="002171/tn/003.jpg" /></li> </ul> </div>

    Read the article

  • jQuery: Checking for length of ul and removing an li element?

    - by Legend
    I am trying to remove the last <li> element from a <ul> element only if it exceeds a particular length. For this, I am doing something like this: var selector = "#ulelement" if($(selector).children().length > threshold) { $(selector + " >:last").remove(); } I don't like the fact that I have to use the selector twice. Is there a shorter way to do this? Something like a "remove-if-length-greater-than-threshold" idea. I was thinking that maybe there is a way to do this using the live() function but I have no idea how.

    Read the article

  • Having trouble on mouse over tabs

    - by user225269
    I downloaded a webpage template from the internet because I don't know how to design webpage on photoshop. This was the one I downloaded: http://www.freewebtemplates.com/download/templates/9839 And modified it. And I have this code for mouse over tabs from dynamic drive. But doesn't seem to be working with the template that I downloaded. Here is my current code: <script src="mouseovertabs.js" type="text/javascript"> </script> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Designed by Web Page Templates</title> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="default.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" align="center" cellpadding="0" cellspacing="0" class="bg1"> <tr> <td class="text1" style="height: 50px;">xd627 information management system</td> </tr> <tr> <div id="mytabsmenu" class="tabsmenuclass"> <td class="bg5"><table border="0" cellspacing="0" cellpadding="0" style="height: 62px; padding-top: 15px;"> <tr align="center"> <td><ul><li><a href="index.html" class="link1">Homepage</a></li></td> <td><li><a href="RegStuds.php" class="link1">Database</a></li></td> <td><li><a href="#" class="link1">About</a></li> </ul></td> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> </div> What might be wrong here,its working perfectly with my previous one, but with no layout at all: <script src="mouseovertabs.js" type="text/javascript"> /*********************************************** * Mouseover Tabs Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div id="mytabsmenu" class="tabsmenuclass"> <ul> <li><a href="" rel="gotsubmenu[selected]">Database Manipulation</a></li> <li><a href="" rel="gotsubmenu" >Register User</a></li> <li><a href="loginform2.php" rel="gotsubmenu" >Logout</a></li> <li><a href=""></a></li> </ul> </div> <div id="mysubmenuarea" class="tabsmenucontentclass"> <!--1st link within submenu container should point to the external submenu contents file--> <a href="submenucontents.htm" style="visibility:hidden">Sub Menu contents</a> </div> <script type="text/javascript"> //mouseovertabsmenu.init("tabs_container_id", "submenu_container_id", "bool_hidecontentsmouseout") mouseovertabsmenu.init("mytabsmenu", "mysubmenuarea", true) </script> </body> </html>

    Read the article

  • Parsing email with Python

    - by Manuel Ceron
    I'm writing a Python script to process emails returned from Procmail. As suggested in this question, I'm using the following Procmail config: :0: |$HOME/process_mail.py My process_mail.py script is receiving an email via stdin like this: From hostname Tue Jun 15 21:43:30 2010 Received: (qmail 8580 invoked from network); 15 Jun 2010 21:43:22 -0400 Received: from mail-fx0-f44.google.com (209.85.161.44) by ip-73-187-35-131.ip.secureserver.net with SMTP; 15 Jun 2010 21:43:22 -0400 Received: by fxm19 with SMTP id 19so170709fxm.3 for <[email protected]>; Tue, 15 Jun 2010 18:47:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.84.1 with SMTP id m1mr2774225mul.26.1276652853684; Tue, 15 Jun 2010 18:47:33 -0700 (PDT) Received: by 10.123.143.4 with HTTP; Tue, 15 Jun 2010 18:47:33 -0700 (PDT) Date: Tue, 15 Jun 2010 20:47:33 -0500 Message-ID: <[email protected]> Subject: TEST 12 From: Full Name <[email protected]> To: [email protected] Content-Type: text/plain; charset=ISO-8859-1 ONE TWO THREE I'm trying to parse the message in this way: >>> import email >>> msg = email.message_from_string(full_message) I want to get message fields like 'From', 'To' and 'Subject'. However, the message object does not contain any of these fields. What am I doing wrong?

    Read the article

  • JSF2 - Why does render response not rerender component setting?

    - by fekete-kamosh
    From the tutorial: "If the request is a postback and errors were encountered during the apply request values phase, process validations phase, or update model values phase, the original page is rendered during Render response phase" (http://java.sun.com/javaee/5/docs/tutorial/doc/bnaqq.html) Does it mean that if view is restored in "Restore View" phase and then any apply request/validation/update model phase fails and skips to "Render response" that Render response only passes restored view without any changes to client? Managed Bean: package cz.test; import javax.faces.bean.ManagedBean; import javax.faces.bean.RequestScoped; @ManagedBean @RequestScoped public class TesterBean { // Simple DataStore (in real world EJB) private static String storedSomeValue = null; private String someValue; public TesterBean() { } public String storeValue() { storedSomeValue = someValue; return "index"; } public String eraseValue() { storedSomeValue = null; return "index"; } public String getSomeValue() { someValue = storedSomeValue; return someValue; } public void setSomeValue(String someValue) { this.someValue = someValue; } } Composite component: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" xmlns:c="http://java.sun.com/jsp/jstl/core"> <!-- INTERFACE --> <composite:interface> <composite:attribute name="currentBehaviour" type="java.lang.String" required="true"/> <composite:attribute name="fieldValue" required="true"/> </composite:interface> <!-- IMPLEMENTATION --> <composite:implementation> <h:panelGrid columns="3"> <c:choose> <c:when test="#{cc.attrs.currentBehaviour == 'READONLY'}" > <h:outputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:outputText> </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'MANDATORY'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}" required="true"> <f:attribute name="requiredMessage" value="Field is mandatory"/> <c:if test="#{empty cc.attrs.fieldValue}"> <f:attribute name="style" value="background-color: yellow;"/> </c:if> </h:inputText>&nbsp;* </c:when> <c:when test="#{cc.attrs.currentBehaviour == 'OPTIONAL'}" > <h:inputText id="fieldValue" value="#{cc.attrs.fieldValue}"> </h:inputText> </c:when> </c:choose> <h:message for="fieldValue" style="color:red;" /> </h:panelGrid> </composite:implementation> Page: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ez="http://java.sun.com/jsf/composite/components"> <h:head> <title>Testing page</title> </h:head> <h:body> <h:form> <h:outputText value="Some value:"/> <ez:field-component currentBehaviour="MANDATORY" fieldValue="#{testerBean.someValue}"/> <h:commandButton value="Store" action="#{testerBean.storeValue}"/> <h:commandButton value="Erase" action="#{testerBean.eraseValue}" immediate="true"/> </h:form> <br/><br/> <b>Why is field's background color not set to yellow?</b> <ol> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> <li>Fill in any value (eg. "Hello") and press Store</li> <li>NOTICE: Yellow background disappeared (as mandatory field has value)</li> <li>Clear text in the field and press Store</li> <li><b>QUESTION: Why is field's background color not set to yellow?</b></li> <li>Press Erase</li> <li>NOTICE: Field has yellow background color (mandatory field with no value)</li> </ol> </h:body>

    Read the article

  • Toggle visibility of DIV based on Dropdown

    - by user1869787
    I have never used Javascript before, only HTML and CSS. I am attempting to have my information show only when selected from my drop down. I don't know any Javascript so any help would be overly appreciated. This is my html so far: <!DOCTYPE HTML> <html> <head> <meta charset="utf-8" /> <title>Gone Fishin'</title> <link href="finale.css" rel="stylesheet" type="text/css"> </head> <div id="wrapper"> <div id="nav"> <ul> <li><a href="Index.html">About Us</a></li> <li><a href="Species.html">List by Species</a></li> <li><a href="County.html">List by County</a></li> <li><a href="apply.html">Reservations</a></li> </ul> </div> <body> <div id="content"> <p>ontent</p> <fieldset> <legend>Choose your Target</legend> <select name="option" id="options"> <option value=""></option> <option value="1">American Shad</option> <option value="2">Black Crappie</option> <option value="3">Bluegill</option> <option value="4">Brook Trout</option> <option value="5">Brown Trout</option> <option value="6">Carp</option> <option value="7">Chain Pickerel</option> <option value="8">Channel Catfish</option> <option value="9">Flathead Catfish</option> <option value="10">Largemouth Bass</option> <option value="11">Muskellunge</option> <option value="12">Norhtern Pike</option> <option value="13">Pumkpinseed</option> <option value="14">Rainbow Trout</option> <option value="15">Readbreast Sunfish</option> <option value="16">Rock Bass</option> <option value="17">Sauger</option> <option value="18">Saugeye</option> <option value="19">Smallmouth Bass</option> <option value="20">Steelhead</option> <option value="21">Striped Bass</option> <option value="22">Walleye</option> <option value="23">White Bass</option> <option value="24">White Crappie</option> <option value="25">White Perch</option> <option value="26">Yellow Perch</option> </select> <div id="option"> <div id="1" style="display: block">Test 1</div> <div id="2">Test 2</div> <div id="3">Test 3</div> <div id="4">Test 4</div> <div id="5">Test 5</div> </div> </fieldset> </div> </body> </div> </html> And this is my CSS: @charset "utf-8"; /* CSS Document */ /*General Styles*/ * {font-family:Verdana, Geneva, sans-serif;} #wrapper {width:85%; margin:auto; background-color:#00CC00;} /*End of General Styles*/ /* nav div styles */ #nav {background-color:#FF0000; text-align:center;} #nav ul li {display:inline-block; background-color: #67e667; border:5px dashed; width: 90px text-align:center;} #nav ul li a:link {background-color:#a60000; width: 90px;} #nav ul li a:visited {background-color: #009999;} #nav ul li a:hover {background-color: #a64b00;} /* end nav styles */ /* content div styles*/ #content {padding: 5px;} #option {display:none;} /*end content styles*/ /*start form styles*/ fieldset {background-color:#ff7400; color:white} label {display:inline-block; width: 150px; float:left; margin-right: 3px;} #form li{margin-bottom:10px;} #dtg li{margin-bottom:5px;} Thank you for any help received

    Read the article

  • jQuery live change problem

    - by Milos
    When I click an element from list, jQuery get class from clicked element and write it in input field. Then value from input need to be written in div#content without any action. HTML: <ul> <li class="NewYork">New York</li> <li class="Paris">Paris</li> <li class="Moscow">Moscow</li> </ul> <input type="text" id="city" value="" /> <div id="content"></div> jQuery: $(document).ready(function() { $('ul li').live('click', function() { var select_value = $(this).attr('class'); $('input#city').val(select_value); return false; }); $('input#city').live('change', function() { var content = $(this).val(); $('#content').text(content+' is beautiful city'); }); });

    Read the article

  • Snow Leopard mounted directory changes permissions sporadically

    - by Galen
    I have a smb mounted directory: /Volumes/myshare This was mounted via Finder "Connect to Server..." with smb://myservername/myshare Everything good so far. However, when I try to access the directory via PHP (running under Apache), it fails with permission denied about 10% of the time. By this I mean that repeated accesses to my page sometimes result in a failure. My PHP page looks like: <?php $cmd = "ls -la /Volumes/ 2>&1"; exec($cmd, $execOut, $exitCode); echo "<PRE>EXIT CODE = $exitCode<BR/>"; foreach($execOut as $line) { echo "$line <BR/>"; } echo "</PRE>"; ?> When it succeeds it looks like: EXIT CODE = 0 total 40 drwxrwxrwt@ 4 root admin 136 Jun 14 12:34 . drwxrwxr-t 30 root admin 1088 Jun 4 13:09 .. drwx------ 1 galen staff 16384 Jun 14 09:28 myshare lrwxr-xr-x 1 root admin 1 Jun 11 16:05 galenhd - / When it fails it looks like: EXIT CODE = 1 ls: myshare: Permission denied total 8 drwxrwxrwt@ 4 root admin 136 Jun 14 12:34 . drwxrwxr-t 30 root admin 1088 Jun 4 13:09 .. lrwxr-xr-x 1 root admin 1 Jun 11 16:05 galenhd - / OTHER INFO: I'm working with the PHP (5.3.1), and Apache server that comes out of the box with Snow Leopard. Also, if I write a PHP script that loops and retries the "ls -la.." from the command-line, it doesn't seem to fail. Nothing is changing about the code and/or filesystem between succeeds and fails, so this appears to be a truly intermittent failure. This is driving me crazy. Anyone have any idea what might be going on? Thanks, Galen

    Read the article

  • jquery .add() is weird

    - by phil
    Hi folks. Why all elements turn red? I only intend to turn <p> red. <ul> <li>list item 1</li> <li>list item 2</li> <li>list item 3</li> </ul> <p>a paragraph</p> <script> $('li').add('p').css('background-color', 'red'); </script>

    Read the article

  • What am I doing wrong for this submenu to not appear?

    - by Doug
    I'm new to jQuery, so please bear with me. I'm trying to make my submenu appear on hover. The second set of <ul> is for submenu. $(document).ready(function(){ $('ul.menu.li').hover( function() { $('ul', this).css('display', 'block'); }, function() { $('ul', this).css('display', 'none'); }); }); <ul id="menu"> <li><a href="#">Item 1</a><li> <ul> <li>Hi</li> </ul> <li><a href="#">Item 2</a></li> </ul>

    Read the article

  • Managing active state (jQuery)

    - by Nimbuz
    <ul> <li><a href="#">item 1</a></li> <li><a href="#">item 2</a></li> <li><a href="#">item 3</a></li> </ul> On click, I'd like to addclass active to the parent li element while also removing the active class from any other element which may be active already. Thanks!

    Read the article

  • CSS overflow : list in a div

    - by Felicita
    I have an image gallery and I dont want give an extra class to third list item: <div class="row"> <ul class="rowUl"> <li>ssss</li> <li>ssss</li> <li>ssss</li> </ul> </div> and css .row { width: 620px; clear: both; overflow: hidden; } .rowUl { width: 645px; float: left; } .rowUl li { width: 220px; float: left; } but the third list item drop in other row. How can I solve this without extra class?

    Read the article

  • Jquery: How can I Get/Set html of a String Variable by using Jquery Selectors ?

    - by ryan.dingy
    Hi all. Firstly, sorry for my English (I'm from China). By reading this article(http://stackoverflow.com/questions/2421719/how-to-apply-jquery-element-selection-to-a-string-variable), I can successfully get Elements from a String which stores HTML text. For example: var htmlstr = "<div><ul><li>some text 1</li></ul></div><div><ul id=list><li>some text 2</li></ul></div>"; var s = $('ul#list', $(htmlstr)).html(); s will be <li>some text 2</li>. It's what I want. But the question is, if I want to add another LI element to this string (htmlstr) how can I do? I set s = new html string but htmlstr doesn't change. Thanks

    Read the article

  • Regular expression replacing only if contained withing a regular expression match?

    - by Tower
    Hi, I have the following: [list] [*] test [*] test [*] test [/list] and I would like to create a regular expression that turns that into: <ul> <li>test</li> <li>test</li> <li>test</li> </ul> I know regex enough to replace simple tags, but in this case I need to replace li tags only if they are contained inside ul. Is there a way to check that before replacing? I am using JavaScript if that matters.

    Read the article

  • Is it safe to delete rotated MySQL binary logs?

    - by Milan Babuškov
    I have a MySQL server with binary logging active. Once a days logs file is "rotated", i.e. MySQL seems to stop writing to it and creates and new log file. For example, I currently have these files in /var/lib/mysql -rw-rw---- 1 mysql mysql 10485760 Jun 7 09:26 ibdata1 -rw-rw---- 1 mysql mysql 5242880 Jun 7 09:26 ib_logfile0 -rw-rw---- 1 mysql mysql 5242880 Jun 2 15:20 ib_logfile1 -rw-rw---- 1 mysql mysql 1916844 Jun 6 09:20 mybinlog.000004 -rw-rw---- 1 mysql mysql 61112500 Jun 7 09:26 mybinlog.000005 -rw-rw---- 1 mysql mysql 15609789 Jun 7 13:57 mybinlog.000006 -rw-rw---- 1 mysql mysql 54 Jun 7 09:26 mybinlog.index and mybinlog.000006 is growing. Can I simply take mybinlog.000004 and mybinlog.000005, zip them up and transfer to another server, or I need to do something else before? What info is stored in mybinlog.index? Only the info about the latest binary log? UPDATE: I understand I can delete the logs with PURGE BINARY LOGS which updates mybinlog.index file. However, I need to transfer logs to another computer before deleting them (I test if backup is valid on another machine). To reduce the transfer size, I wish to bzip2 the files. What will PURGE BINARY LOGS do if log files are not "there" anymore?

    Read the article

  • jQuery doesn't work after an Ajax post

    - by user1758979
    I'm using jQuery to sort a list of entries, between <LI></LI> tags, and then an Ajax post to validate the order and 'update' the page with the content returned. $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { $('html').html(data); OnloadFunction (); } }); Then, I lose the ability to sort the list (I'm not sure if clear...). I tried to move the content of the $(document).ready inside the OnloadFunction (), and call it with <script>OnloadFunction ();</script> inside the block dealing with the modifications to do : $action= $_GET['action']; if ($action == "modify") { // Code here } but it doesn't work... I can't figure out how to do that. Could anyone help ? I stripped out the main part of the code to keep only the essential (filename: test.php) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <script type="text/javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript" src="jquery-ui-1.9.0.custom.min.js"></script> <script> $(document).ready(function(){ //alert("I am ready"); OnloadFunction (); }); function OnloadFunction () { $(function() { $("#SortColumn ul").sortable({ opacity: 0.6, cursor: 'move', update: function() {} }); }); //alert('OnloadFunction ends'); } function valider(){ var SortedId = new Array(); SortIdNb = 0; $('#SortColumn ul li').each(function() { SortedId.push(this.id); }); var data = { /* Real code contains an array with the <li> id */ CheckedId: "CheckedId", SortedId: SortedId, }; data = JSON.stringify(data); $.ajax({url: "./test.php?id=<?php echo $id; ?>&action=modify", contenttype: "application/x-www-form-urlencoded;charset=utf-8", data: {myJson: data}, type: 'post', success: function(data) { //alert(data); $('html').html(data); OnloadFunction (); } }); } </script> </head> <body> <? $action= $_GET['action']; $id = $_GET['id']; if ($id == 0) {$id=1;} $id += 1; if ($action == "modify") { echo "action: modify<br>"; echo "id (àvèc aççént$): ".$id."<br>"; // "(àvèc aççént$)" to check characters because character set is incorrect after the ajax post $data = json_decode($_POST['myJson'], true); // PHP code here to treat the new list send via the post and update the database print_r($data); } ?> <!-- PHP code here to get the following list from the database --> <div id="SortColumn"> <ul> <li id="recordsArray_1">recordsArray_1</li> <li id="recordsArray_2">recordsArray_2</li> <li id="recordsArray_3">recordsArray_3</li> <li id="recordsArray_4">recordsArray_4</li> <li id="recordsArray_5">recordsArray_5</li> </ul> </div> <input type="button" value="Modifier" onclick="valider();"> </body> </html>

    Read the article

  • Can this PHP function be improved?

    - by jasondavis
    Below is some code I am working on for a navigation menu, if you are on a certain page, it will add a "current" css class to the proper tab. I am curious if there is a better way to do this in PHP because it really seems like a lot of code to do such a simple task? My pages will also have a jquery library already loaded, would it be better to set the tab with jquery instead of PHP? Any tips appreciated <?PHP active_header('page identifier goes here'); //ie; 'home' or 'users.online' function active_header($page_name) { // arrays for header menu selector $header_home = array('home' => true); $header_users = array( 'users.online' => true, 'users.online.male' => true, 'users.online.female' => true, 'users.online.friends' => true, 'users.location' => true, 'users.featured' => true, 'users.new' => true, 'users.browse' => true, 'users.search' => true, 'users.staff' => true ); $header_forum = array('forum' => true); $header_more = array( 'widgets' => true, 'news' => true, 'promote' => true, 'development' => true, 'bookmarks' => true, 'about' => true ); $header_money = array( 'account.money' => true, 'account.store' => true, 'account.lottery' => true, 'users.top.money' => true ); $header_account = array('account' => true); $header_mail = array( 'mail.inbox' => true, 'mail.sentbox' => true, 'mail.trash' => true, 'bulletins.post' => true, 'bulletins.my' => true, 'bulletins' => true ); // set variables if there array value exist if (isset($header_home[$page_name])){ $current_home = 'current'; }else if (isset($header_users[$page_name])){ $current_users = 'current'; }else if (isset($header_forum[$page_name])){ $current_forum = 'current'; }else if (isset($header_more[$page_name])){ $current_more = 'current'; }else if (isset($header_money[$page_name])){ $current_money = 'current'; }else if (isset($header_account[$page_name])){ $current_account = 'current'; }else if (isset($header_mail[$page_name])){ $current_mail = 'current'; } // show the links echo '<li class="' . (isset($current_home) ? $current_home : '') . '"><a href=""><em>Home</em></a></li>'; echo '<li class="' . (isset($current_users) ? $current_users : '') . '"><a href=""><em>Users</em></a></li>'; echo '<li class="' . (isset($current_forum) ? $current_forum : '') . '"><a href=""><em>Forum</em></a></li>'; echo '<li class="' . (isset($current_more) ? $current_more : '') . '"><a href=""><em>More</em></a></li>'; echo '<li class="' . (isset($current_money) ? $current_money : '') . '"><a href=""><em>Money</em></a></li>'; echo '<li class="' . (isset($current_account) ? $current_account : '') . '"><a href=""><em>Account</em></a></li>'; echo '<li class="' . (isset($current_mail) ? $current_mail : '') . '"><a href=""><em>Mail</em></a></li>'; } ?>

    Read the article

  • reorder list elements - jQuery?

    - by Alex
    Hello, I am experimenting with jQuery lately, and I was wondering if it's possible with js or pure jquery to reorder <li> elements. So if I have a silly list like the following: <ul> <li>Foo</li> <li>Bar</li> <li>Cheese</li> </ul> How would I move the list elements around? Like put the list element with Cheese before the list element with Foo or move Foo to after Bar. So is it possible? If so, how? Thanks!!

    Read the article

  • jQuery on/delegate correct syntax

    - by KryptoniteDove
    As the jQuery API is currently down, is anyone able to assist me with the below? I am ajax loading an unordered list into the web page and need to be able to attach hover and click events to the list items. <ul> <li class="option">Item 1</li> <li class="option">Item 1</li> <li class="option">Item 1</li> </ul> So far I have tried a few variations of the below jQuery code using .on for version 1.7+ $("ul").on("click", "li .option", function(){ alert($(this).text()); }); Can anyone point me in the right direction? I'm aware that .live has been depreciated and that .delegate has been superceeded so really only looking for a solution that will allow me to use .on. Thanks as always!

    Read the article

  • Simple Ticker (jQuery)

    - by Nimbuz
    <ul> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> </ul> I'd like to show only one li at a time using slide effect, thats it. I'd like to avoid using plugins for something as simple as this. Thanks in advance for your help.

    Read the article

  • Oracle 10g for Windows does not start up on system boot

    - by Mike Dimmick
    We have an Oracle 10g Enterprise Edition installation (10.2.0.1.0) on a Windows Server 2003 virtual machine. It was initially created with Virtual Server 2005 R2 SP1 but has now been migrated to Windows Server 2008 Hyper-V. The services start on system boot, but the instance does not start up. This problem was actually occurring on Virtual Server after a migration from one server to another, but I managed to fix it then with: oradim -edit -sid ORCL -startmode auto However, this now has no effect. oradim.log (in %OracleHome%\database\oradim.log) says: Thu Jun 10 14:14:48 2010 C:\oracle\product\10.2.0\db_3\bin\oradim.exe -startup -sid orcl -usrpwd * -log oradim.log -nocheck 0 Thu Jun 10 14:14:48 2010 ORA-12560: TNS:protocol adapter error sqlnet.log in the same folder has: Fatal NI connect error 12560, connecting to: (DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=orcl)(CID=(PROGRAM=C:\oracle\product\10.2.0\db_3\bin\oradim.exe)(HOST=ORACLE-VM)(USER=SYSTEM)))) VERSION INFORMATION: TNS for 32-bit Windows: Version 10.2.0.1.0 - Production Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 10.2.0.1.0 - Production Time: 10-JUN-2010 14:14:48 Tracing not turned on. Tns error struct: ns main err code: 12560 TNS-12560: TNS:protocol adapter error ns secondary err code: 0 nt main err code: 530 TNS-00530: Protocol adapter error nt secondary err code: 2 nt OS err code: 0 The ORA_ORCL_AUTOSTART registry value is set to TRUE, so it should be auto-starting - and you can see that it's trying to. The problem also occurs when stopping and restarting the OracleServiceORCL service. I've enabled SQL*Net tracing which shows: [10-JUN-2010 15:09:33.919] snlpcss: entry [10-JUN-2010 15:09:34.419] snlpcss: Unable to spawn Oracle oracle (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) orcl, error 2. [10-JUN-2010 15:09:34.419] snlpcall: exit On a hunch that error 2 is Windows error 2 (file not found) I tried restarting the service with Process Monitor watching oradim.exe, but this appears to delay things just enough that it always works. Right now I have a horrible hack where I've created a Scheduled Task to run oradim -startup -sid ORCL when the Administrator account logs on, and set the VM to auto-logon. I'd still like to work out why it's not working.

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >