Search Results

Search found 3 results on 1 pages for 'user1104854'.

Page 1/1 | 1 

  • changing order of items in tkinter listbox

    - by user1104854
    Is there an easier way to change the order of items in a tkinter listbox than deleting the values for specific key, then re-entering new info? For example, I want to be able to re-arrange items in a listbox. If I want to swap the position of two, this is what I've done. It works, but I just want to see if there's a quicker way to do this. def moveup(self,selection): value1 = int(selection[0]) - 1 #value to be moved down one position value2 = selection #value to be moved up one position nameAbove = self.fileListSorted.get(value1) #name to be moved down nameBelow = self.fileListSorted.get(value2) #name to be moved up self.fileListSorted.delete(value1,value1) self.fileListSorted.insert(value1,nameBelow) self.fileListSorted.delete(value2,value2) self.fileListSorted.insert(value2,nameAbove)

    Read the article

  • Providing updating suggestions list with javascript, php and ajax

    - by user1104854
    I'm trying to modify this example on making a live updating list to integrate it with my API. So, instead of using GET on the page with the form, I'd like to send it to that page via a function call. So, here's my form // message.php //function to display the hint sent from gethint.php function message_hint($hint){ echo $hint; } //displays the form for sending messages function send_message_form($to_user,$title,$message){ include 'gethint.php'; ?> <table> <form name = "send_message" method="post"> <td>Send A Message</td> <tr><td>To:</td><td><input type = "text" size="50" name="to_user" id = "to_user" value ="<? echo $to_user; ?>" onkeyup="showHint(this.value)"></td></tr> <tr><td>Title:</td><td><input type = "text" size="50" name="message_title"></td></tr> <tr><td>Message:</td><td><textarea rows="4" cols="50" name="message_details"></textarea></td></tr> <tr><td><input type="submit" name="submit_message"></td></tr> </table> </form> <? } Here's the head of message.php <head> <script> function showHint(str){ var to_user = document.getElementById("to_user").value //to_user is the id of the textbox if (str.length==0){ to_user.innerHTML=""; return; } if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ alert(to_user) //properly displays the name via alert box to_user.innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","gethint.php?q="+to_user,true); xmlhttp.send(); } </script> </head> The page gethint.php is exactly the same, aside from this at the bottom. //echo $response //this was the original output $message = new messages; $message->message_hint($response);

    Read the article

  • If statement in MySQL query with PHP

    - by user1104854
    Is it possible to use an if statement in a MySQL query in a similar what I'm showing? I want to grab some information for upcoming events(not ones with previous dates). ini_set('date.timezone', 'America/New_York'); $timestamp = date('m/d/Y'); $sql = "select eventID,eventTitle,eventDate from events where eventLocationID = $locationID ORDER BY eventDate DESC IF(eventDate > $timestamp) "; I really want to avoid doing post-query if statements that will only print if it's after today's date because I run it through a pagination function, and I'd really prefer to avoid tinkering with that.

    Read the article

1