Search Results

Search found 11210 results on 449 pages for 'title'.

Page 71/449 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • Contingent Header Category Label

    - by poindexter
    Right now the header has a bit of code in it that queries the section name and then uses that section name as the h1 title in the page. It works fine. However, I want to selectively break that operation in certain categories and give myself the ability to manually enter the h1 title for a given section. Here's what I'm struggling with: how can I maintain the automatic query and title selection in most instances, but selectively break it in a given category (the 'blog' category, for starters)? Thanks for taking a look, I appreciate your help! Here's the code that drives the existing function (it's the get_the_section_name part): <?php if(!is_home()){?> <div class="section <?php echo get_the_section_name();?>"> <?php $sectitle = get_the_section_name(); $sectitle = str_ireplace("-"," ",$sectitle); echo '<h1>' . $sectitle . '</h1>';?> <p class="breadcrumbs"> <?php if(function_exists('bcn_display')) { bcn_display(); } ?> </p> </div> <div class="columns"> <?php } ?> Here's a page that shows what it looks like displayed (see the title in the blue graphic underneath the main nav near the top of the page): http://69.20.59.228/category/blog/

    Read the article

  • Unable to register achievements

    - by abe
    I've been unable to register any achievements. I keep getting the following: {"error":{"message":"(#3502) Object at achievement URL is not of type game.achievement","type":"OAuthException","code":3502}} When I run my URL through the linter, I get: Open Graph Warnings That Should Be Fixed Inferred Property: The 'og:url' property should be explicitly provided, even if a value can be inferred from other tags. Inferred Property: The 'og:title' property should be explicitly provided, even if a value can be inferred from other tags. Although when I load the URL myself I clearly see those set in the meta tags. My HTML looks like: <html> <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# game: http://ogp.me/ns/game#"> <meta property="fb:app_id" content="<MY_APP_ID>" /> <meta property="og:type" content="game.achievement" /> <meta property="og:url" content="http://<MY_DOMAIN>/ach10.html" /> <meta property="og:title" content="Title" /> <meta property="og:description" content="Description" /> <meta property="og:image" content="http://placekitten.com/g/200/300" /> </head> <body> Hmm.. </body> </html> Also interesting, is the graph API sees it as: { "url": "http://<MY_DOMAIN>/ach10.html", "type": "website", "title": "http://<MY_DOMAIN>/ach10.html", "updated_time": "2012-03-09T19:49:14+0000", "id": "<ID>" } And the scraped URL returns nothing ... anyone have any ideas? I've also tried adding the Game Achievement object in the Open Graph settings and every combination of Sandbox Mode/Social Discovery enabled and disabled.

    Read the article

  • colorbox not displaying first caption from flickr gallery integration

    - by Mark
    I am pulling small thumbnails into my page from the flickr API, and using Colorbox to display larger thumbnails and captions from the title attribute. Using the API with C#. However, on the first instance of opening colorbox it does not display the caption from the anchors title attribute. If you click next or previous then it appears. The actual caption is physically there in the source code, just not getting put into the colorbox window. Demo here, if you click on a thumbnail you will see there is no caption, click next then prev and it will appear. Here's the code: <script type="text/javascript"> $(function() { $("a[rel='group']").colorbox({ opacity: 0.75 }); }); </script> <a href='http://farm6.static.flickr.com/5015/5511378425_e63d4a62f7.jpg' title='Little Hermit (Peter Dunn)' rel='group' class='tooltip'> <img src='http://farm6.static.flickr.com/5015/5511378425_e63d4a62f7_s.jpg' alt='Little Hermit (Peter Dunn)' /> </a> If i view source, the title attribute is populated with the caption, but if i ook in firebug it is not in the colorbox code. Any help on this would be great Ive ran out of ideas!

    Read the article

  • how to submit a from with validation in PHP?

    - by jitendra
    I want to submit this form through PHP. with validation for required field and validation for phone number and email field also <form action="" method="" id="get-protected"> <div class="row requiredRow"> <label for="txt_FirstName"> First Name</label> <input id="txt_FirstName" type="text" class="required" title="First Name. This is a required field" /> </div> <div class="row"> <label for="txt_LastName"> Last Name</label> <input id="txt_LastName" type="text" title="First Name. This is a required field" /> </div> <div class="row"> <label for="txt_Phone"> Phone</label> <input id="txt_Phone" type="text" title="First Name. This is a required field" /> </div> <div class="row requiredRow"> <label for="txt_Email"> Email</label> <input id="txt_Email" type="text" class="required" title="Email. This is a required field" /> </div> <div class="row"> <input type="submit" value="" class="button" /> </div> </form>

    Read the article

  • Centering in IE5/6/7/8, and FF

    - by splatto
    I'm trying to centre the content of a div such that the display is correct in IE 5,6,7 and 8, as well as FF. <div id="YoutubeClip"> <h3>Subscribe on YouTube!</h3><br> <ul class="gallery clearfix"><a href="http://www.someyoutubevideo.com" rel="prettyPhoto" title="Some youtube title"><img alt="some youtube title" src="youtube clip image" border="0"></a></ul> Some youtube title </div> As expected, this displays the image and the text centered in FF. In IE5, the image is left justified. The text is also left justified, with only one word on a line. It appears like this. IE 6 has the same problem as above. IE 7 appears to have the same problem, but when I put a border around the div, the content overflows the border. The display appears correct in IE8 Any help into this would be great. I'm trying to learn CSS better and I haven't been able to figure out the intricacies of this issue yet.

    Read the article

  • Parsing XHTML with inline tags

    - by user290796
    Hi, I'm trying to parse an XHTML document using TBXML on the iPhone (although I would be happy to use either libxml2 or NSXMLParser if it would be easier). I need to extract the content of the body as a series of paragraphs and maintain the inline tags, for example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Title</title> <link rel="stylesheet" href="css/style.css" type="text/css"/> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8"/> </head> <body> <div class="body"> <div> <h3>Title</h3> <p>Paragraph with <em>inline</em> tags</p> <img src="image.png" /> </div> </div> </body> </html> I need to extract the paragraph but maintain the <em>inline</em> content with the paragraph, all my testing so far has extracted that as a subelement without me knowing exactly where it fitted in the paragraph. Can anyone suggest a way to do this? Thanks.

    Read the article

  • VB.NET editing existing that with a form

    - by user127147
    Hi there, I have a simple questions that puzzles me. I need a little bit of refreashment with VB as I have been away for a while. I have a form that adds new contacts. New contacts are added by pressing an appropriate button and they appear as an entry in the list on the form. I try now to add an edit button that will edit existing entries. User will select a given entry on the list and press edit button and will be presented with an appropriate form (AddContFrm). Right now it simply adds another entry with the same title. Logic is handled in a class called Contact.vb Here is my code. Public Class Contact Public Contact As String Public Title As String Public Fname As String Public Surname As String Public Address As String Private myCont As String Public Property Cont() Get Return myCont End Get Set(ByVal value) myCont = Value End Set End Property Public Overrides Function ToString() As String Return Me.Cont End Function Sub NewContact() FName = frmAddCont.txtFName.ToString frmStart.lstContact.Items.Add(FName) frmAddCont.Hide() End Sub Public Sub Display() Dim C As New Contact 'C.Cont = InputBox("Enter a title for this contact.") C.Cont = frmAddCont.txtTitle.Text C.Fname = frmAddCont.txtFName.Text C.Surname = frmAddCont.txtSName.Text C.Address = frmAddCont.txtAddress.Text 'frmStart.lstContact.Items.Add(C.Cont.ToString) frmStart.lstContact.Items.Add(C) End Sub End Class AddContFrm Public Class frmAddCont Public Class ControlObject Dim Title As String Dim FName As String Dim SName As String Dim Address As String Dim TelephoneNumber As Integer Dim emailAddress As String Dim Website As String Dim Photograph As String End Class Private Sub btnConfirmAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConfirmAdd.Click Dim C As New Contact C.Display() Me.Hide() End Sub Private Sub frmAddCont_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class and frmStart.vb Public Class frmStart Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click frmAddCont.Show() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDel.Click Dim DelCont As Contact DelCont = Me.lstContact.SelectedItem() lstContact.Items.Remove(DelCont) End Sub Private Sub lstContact_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstContact.SelectedIndexChanged End Sub Private Sub btnEdit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEdit.Click Dim C As Contact If lstContact.SelectedItem IsNot Nothing Then C = DirectCast(lstContact.SelectedItem, Contact) C.Display() End If End Sub End Class

    Read the article

  • Working With Feeds and Lists

    - by Nathan Campos
    I'm using a ListView component to list up some informations at a RSS feed, but when the user clicks the row, I want to change into a detailed view of that RSS Item, so far I've done this: function parseFeed(feed) { var html = ""; for(var i = 0; i < feed.items.length && i < 5; i++) { var item = feed.items[i]; var title = item.title; html += "\n<li onClick='goDetailed()'>\n"; html += "<h3><a href='#' class='ui-link-inherit'>" + title + "</a></h3>\n"; html += "<p>" + item.description + "</p>\n"; html += "</li>"; } $("#dList").append(html); $("#dList").listview('refresh'); } function goDetailed() { $.mobile.changePage($('#detailedPage')); } One of my problems is that the Back button won't come back(it does nothing). My other question is how I can pass the item.title, item.description, item.link and item.updated of the selected row(feed item) to some <div data-role="content">'s at the detail page.

    Read the article

  • Drupal theme preprocess function - primary links and suckerfish menus

    - by slimcady
    I have a preprocess function that works fine when the menu is single level list. However I would like it to work w/ suckerfish menus. I want to add a class to the top level menu item so that I can style it. This is the code I used for the single level menu: function cti_flex_preprocess_page(&$vars, $hook) { // Make a shortcut for the primary links variables $primary_links = $vars['primary_links']; // Loop thru the menu, adding a new class for CSS selectors $i = 1; foreach ($primary_links as $link => $attributes){ // Append the new class to existing classes for each menu item $class = $attributes['attributes']['class'] . " item-$i"; // Add revised classes back to the primary links temp variable $primary_links[$link]['attributes']['class'] = $class; $link['title'] = '<span class="hide">' . check_plain($link['title']) . '</span>'; $i++; } // end the foreach loop // reset the variable to contain the new markup $vars['primary_links'] = $primary_links; } I've been trying to use the menu_tree() function to no avail, for example: function cti_flex_preprocess_page(&$vars, $hook) { // Make a shortcut for the primary links variables $primary_links = $vars['primary_links']; // Loop thru the menu, adding a new class for CSS selectors $i = 1; foreach ($primary_links as $link => $attributes){ // Append the new class to existing classes for each menu item $class = $attributes['attributes']['class'] . " item-$i"; // Add revised classes back to the primary links temp variable $primary_links[$link]['attributes']['class'] = $class; $link['title'] = '<span class="hide">' . check_plain($link['title']) . '</span>'; $i++; } // end the foreach loop // reset the variable to contain the new markup $vars['primary_links_tree'] = menu_tree(variable_get('menu_primary_links_source', '$primary_links')); } Any ideas would be greatly appreciated.

    Read the article

  • Haml Inherit Templates

    - by kjfletch
    I'm using Haml (Haml/Sass 3.0.9 - Classy Cassidy) stand-alone to generate static HTML. I want to create a shared layout template that all my other templates inherit. Layout.haml %html %head %title Test Template %body .Content Content.haml SOMEHOW INHERIT Layout.haml SOMEHOW Change the title of the page "My Content". %p This is my content To produce: Content.html <html> <head> <title>My Content</title> </head> <body> <div class="Content"> <p>This is my content</p> </div> </body> </html> But this doesn't seem possible. I have seen the use of rendering partials when using Haml with Rails but can't find any solution when using Haml stand-alone. Having to put the layout code in all of my templates would be a maintenance nightmare; so my question is how do I avoid doing this? Is there a standard way to solve this problem? Have I missed something fundamental?

    Read the article

  • How to get values of xml elements?

    - by user187580
    Hi, I have some xml data and I am trying to access some elements. The structure of data is as below (using print_r($data)). I can get $data->{'parent'}->title, it works but if I try to get value of href using $data->{'parent'}->link[0]->{'@attributes'}->href .. it doesnt work .. any ideas? Thanks SimpleXMLElement Object ( [@attributes] => Array ( [children] => 29 [modules] => 0 ) [title] => Test title [link] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => data.php?id=2322 [rel] => self [type] => application/xml ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => data.php?id=2342 [rel] => alternate [type] => text/html ) ) ) [parent] => SimpleXMLElement Object ( [@attributes] => Array ( [children] => 6 [modules] => 0 ) [title] => Top [link] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => /data.php?id=5763 [rel] => self [type] => application/xml ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [href] => /data.php?id=2342 [rel] => alternate [type] => text/html ) ) ) ) )

    Read the article

  • write regex code in java for following data

    - by giri
    <table> <tr> <td style="width:180px"> <a href="/search?q=user:240698+[java]" class="post-tag" title="show all posts by this user in 'java'">java</a><span class="item-multiplier">&times;&nbsp;176</span><br> <a href="/search?q=user:240698+[servlets]" class="post-tag" title="show all posts by this user in 'servlets'">servlets</a><span class="item-multiplier">&times;&nbsp;25</span><br> <a href="/search?q=user:240698+[jsp]" class="post-tag" title="show all posts by this user in 'jsp'">jsp</a><span class="item-multiplier">&times;&nbsp;11</span><br> <a href="/search?q=user:240698+[core]" class="post-tag" title="show all posts by this user in 'core'">core</a><span class="item-multiplier">&times;&nbsp;9</span><br> </tr> </table> from the above code I need to fetch only java, servlets, jsp and core. Can anybody plz help me out to write a regex in java to fetch those? Thanks

    Read the article

  • How do I avoid having JSONP returns cached in an HTML5 offline application?

    - by Kent Brewster
    I had good luck with cached offline apps until I tried including data from JSONP endpoints. Here's a tiny example, which loads a single movie from the new Netflix widget API: <!DOCTYPE html> <html manifest="main.manifest"> <head> <title>Testing!</title> </head> <body> <p>Attempting to recover a title from Netflix now...</p> <script type="text/javascript"> function ping(r) { alert('API reply: ' + r.catalog_title.title.regular); } var cb = new Date().getTime(); var s = document.createElement('SCRIPT'); s.src = 'http://movi.es/7Soq?v=2.0&output=json&expand=widget&callback=ping&cacheBuster=' + cb; alert('SCRIPT src: ' + s.src); s.type = 'text/javascript'; document.getElementsByTagName('BODY')[0].appendChild(s); </script> </body> </html> ... and here's the contents of my manifest, main.manifest, which contains no files and is only there so my browser knows to cache the calling HTML file. CACHE MANIFEST Yes, I've confirmed that my server is sending the manifest down with the correct content type, text/cache-manifest. The app works fine--meaning both alerts show--the first time I run it, but subsequent runs, even with the attempt at cache-busting in line 10, seem to be attempting to load the script from cache no matter what the query string is. I see the alert showing the script source, but the callback never fires. If I remove the manifest link from line 2 and reset my browser--being Safari and the iPhone Simulator--to clear cache, it works every time. I've also tried alerting the number of SCRIPT tags in the page, and it's definitely seeing both the existing and dynamically-created tag in all cases.

    Read the article

  • Accessing data entered into multiple Django forms and generating them onto a new URL

    - by pedjk
    I have a projects page where users can start up new projects. Each project has two forms. The two forms are: class ProjectForm(forms.Form): Title = forms.CharField(max_length=100, widget=_hfill) class SsdForm(forms.Form): Status = forms.ModelChoiceField(queryset=P.ProjectStatus.objects.all()) With their respective models as follows: class Project(DeleteFlagModel): Title = models.CharField(max_length=100) class Ssd(models.Model): Status = models.ForeignKey(ProjectStatus) Now when a user fills out these two forms, the data is saved into the database. What I want to do is access this data and generate it onto a new URL. So I want to get the "Title" and the "Status" from these two forms and then show them on a new page for that one project. I don't want the "Title" and "Status" from all the projects to show up, just for one project at a time. If this makes sense, how would I do this? I'm very new to Django and Python (though I've read the Django tutorials) so I need as much help as possible. Thanks in advance Edit: The ProjectStatus code is (under models): class ProjectStatus(models.Model): Name = models.CharField(max_length=30) def __unicode__(self): return self.Name

    Read the article

  • Java-Hibernate: How can I translate these tables to hibernate annotations?

    - by penas
    I need to create a simple application using these tables: http://stackoverflow.com/questions/2612848/are-these-tables-respect-the-3nf-database-normalization I have created the application using simple old JDBC, but I would like to see how the application would look like using Hibernate, but I don't know how to put the sql code in java. I have found LOTS of examples, but I'm pretty much confused about using Hibernate and I don't know If I made such a good joob. For example, for the first three tables: AUTHOR table * Author_ID, PK * First_Name * Last_Name TITLES table * TITLE_ID, PK * NAME * Author_ID, FK DOMAIN table * DOMAIN_ID, PK * NAME * TITLE_ID, FK The code in java: Table 1 @Entity @Table(name = "AUTHORS", schema = "LIBRARY") public class Author{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "Author_ID") private int authorId; @Column(name = "First_Name", nullable = false, length = 50) private String firstName; @Column(name = "Last_Name", nullable = false, length = 40) private String lastName; @OneToMany @JoinColumn(name = "Title_ID") private List<Title> titles; Table 2 @Entity @Table(name = "TITLES") public class Title{ @Id @Column(name = "Title_ID") private int titleID; @Column(name = "Name", nullable = false, length = 50) private String name; @ManyToOne @JoinColumn(name = "Domain_ID") private Domain domains; Table 3 @Entity @Table(name = "DOMAINS") public class Domain{ @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "Domain_ID") private int Domain_ID; @Column(name = "Name", nullable = false, length = 50) private String name; @OneToOne(mappedBy = "domains") private Title title; } Any good? :)

    Read the article

  • performing more than one Where in query return null!!! why? how to fix this?

    - by Sadegh
    hi, i have wrote a method that filters output with provided query and return it. when one Where excuted; it return correct output but when more than one Where excuted; output is null and Exception occured with message "Enumeration yielded no results". why? how i can fix it? public IQueryable<SearchResult> PerformSearch(string query, int skip = 0, int take = 5) { if (!string.IsNullOrEmpty(query)) { var queryList = query.Split('+').ToList(); var results = GENERATERESULTS(); string key; foreach (string _q in queryList) { if (_q.StartsWith("(") && _q.EndsWith(")")) { key = _q.Replace("(", "").Replace(")", ""); results = results.Where(q => q.Title.Contains(key, StringComparison.CurrentCultureIgnoreCase)); } else if (_q.StartsWith("\"") && _q.EndsWith("\"")) { key = _q.Replace("\"", "").Replace("\"", ""); results = results.Where(q => q.Title.Contains(key, StringComparison.CurrentCulture)); } else if (_q.StartsWith("-(") && _q.EndsWith(")")) { key = _q.Replace("-(", "").Replace(")", ""); results = results.Where(q=> !q.Title.Contains(key, StringComparison.CurrentCultureIgnoreCase)); } else { key = _q; results = results.Where(q => q.Title.Contains(key, StringComparison.CurrentCulture)); } } this._Count = results.Count(); results = results.Skip(skip).Take(take); this._EndOn = DateTime.Now; this.ExecutionTime(); return results; } else return null; } thanks in advance ;)

    Read the article

  • Titanium TableViewRow classname with custom rows

    - by pancake
    I would like to know in what way the 'className' property of a Ti.UI.TableViewRow helps when creating custom rows. For example, I populate a tableview with custom rows in the following way: function populateTableView(tableView, data) { var rows = []; var row; var title, image; var i; for (i = 0; i < data.length; i++) { title = Ti.UI.createLabel({ text : data[i].title, width : 100, height: 30, top: 5, left: 25 }); image = Ti.UI.createImage({ image : 'some_image.png', width: 30, height: 30, top: 5, left: 5 }); /* and, like, 5+ more views or whatever */ row = Ti.UI.createTableViewRow(); row.add(titleLabel); row.add(image); rows.push(row); } tableView.setData(rows); } Of course, this example of a "custom" row is easily created using the standard title and image properties of the TableViewRow, but that isn't the point. How is the allocation of new labels, image views and other child views of a table view prevented in favour of their reuse? I know in iOS this is achieved by using the method -[UITableView dequeueReusableCellWithIdentifier:] to fetch a row object from a 'reservoir' (so 'className' is 'identifier' here) that isn't currently being used for displaying data, but already has the needed child views laid out correctly in it, thus only requiring to update the data contained within (text, image data, etc). As this system is so unbelievably simple, I have a lot of trouble believing the method employed by the Titanium API does not support this. After reading through the API and searching the web, I do however suspect this is the case. The 'className' property is recommended as an easy way to make table views more efficient in Titanium, but its relation to custom table view rows is not explained in any way. If anyone could clarify this matter for me, I would be very grateful.

    Read the article

  • How hide some nodes in Richfaces Tree (do not render nodes by condition)?

    - by VestniK
    I have a tree of categories and courses in my SEAM application. Courses may be active and inactive. I want to be able to show only active or all courses in my tree. I've decided to always build complete tree in my PAGE scope component since building this tree is quite expensive operation. I have boolean flag courseActive in the data wrapped by TreeNode<T>. Now I can't find the way to show courses node only if this flag is true. The best result I've achieved with the following code: <h:outputLabel for="showInactiveCheckbox" value="show all courses: "/> <h:selectBooleanCheckbox id="showInactiveCheckbox" value="#{categoryTreeEditorModel.showAllCoursesInTree}"> <a4j:support event="onchange" reRender="categoryTree"/> </h:selectBooleanCheckbox> <rich:tree id="categoryTree" value="#{categoryTree}" var="item" switchType="ajax" ajaxSubmitSelection="true" reRender="categoryTree,controls" adviseNodeOpened="#{categoryTreeActions.adviseRootOpened}" nodeSelectListener="#{categoryTreeActions.processSelection}" nodeFace="#{item.typeName}"> <rich:treeNode type="Category" icon="..." iconLeaf="..."> <h:outputText value="#{item.title}"/> </rich:treeNode> <rich:treeNode type="Course" icon="..." iconLeaf="..." rendered="#{item.courseActive or categoryTreeEditorModel.showAllCoursesInTree}"> <h:outputText rendered="#{item.courseActive}" value="#{item.title}"/> <h:outputText rendered="#{not item.courseActive}" value="#{item.title}" style="color:#{a4jSkin.inactiveTextColor}"/> </rich:treeNode> </rich:tree> the only problem is if some node is not listed in any rich:treeNode it just still shown with title obtained by Object.toString() method insted of being hidden. Does anybody know how to not show some nodes in the Richfases tree according to some condition?

    Read the article

  • jQuery Form Validation being bypassed

    - by user1953681
    Can someone tell me what is wrong with my jQuery validation? It is not validating my form, rather, just ignoring the code resulting in no check of the inputs. Form: <form class="form" accept-charset="UTF-8" action="URL-to-complete-form" method="POST" onsubmit="return validateForm();"> <input class="form-name" type="text" placeholder="Name"></div> <input class="form-email" type="text"placeholder="Email"></div> <input style="background-color: #fc8f12;" type="submit" value="Subscribe"> </div> </form> Javascript: function validateForm() { // Validate Name var title = $(".form-name").val(); if (title=="" ||title=="Name" || title==null) { } else { alert("Please enter a name!"); } // Validate Email var email = $(".form-email").val(); if ((/(.+)@(.+){2,}\.(.+){2,}/.test(email)) || email=="" || email=="Email" || email==null) { } else { alert("Please enter a valid email"); } return false; } Thank you all for your time and help.

    Read the article

  • Heroku: Postgres type operator error after migrating DB from MySQL

    - by sevennineteen
    This is a follow-up to a question I'd asked earlier which phrased this as more of a programming problem than a database problem. http://stackoverflow.com/questions/2935985/postgres-error-with-sinatra-haml-datamapper-on-heroku I believe the problem has been isolated to the storage of the ID column in Heroku's Postgres database after running db:push. In short, my app runs properly on my original MySQL database, but throws Postgres errors on Heroku when executing any query on the ID column, which seems to have been stored in Postgres as TEXT even though it is stored as INT in MySQL. My question is why the ID column is being created as INT in Postgres on the data transfer to Heroku, and whether there's any way for me to prevent this. Here's the output from a heroku console session which demonstrates the issue: Ruby console for myapp.heroku.com >> Post.first.title => "Welcome to First!" >> Post.first.title.class => String >> Post.first.id => 1 >> Post.first.id.class => Fixnum >> Post[1] PostgresError: ERROR: operator does not exist: text = integer LINE 1: ...", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. Query: SELECT "id", "name", "email", "url", "title", "created_at" FROM "posts" WHERE ("id" = 1) ORDER BY "id" LIMIT 1 Thanks!

    Read the article

  • Why does animate not work for the first few 'selections' of my next button?

    - by Josiah
    I'll just start right off the bat and say I'm fairly new to JQuery, so if you see some glaring issues with my code....let me know what I'm doing wrong! Either way, I've been working on a script to fade divs in and out using the z-index and animate. It "works" after about 2-3 clicks, but the first two clicks do not fade or animate as I was hoping....why is that? I'll just throw javascript up here, but if you need/want more code, just let me know. Thanks! $(document).ready(function() { //Slide rotation/movement variables var first = $('#main div.slide:first').attr('title'); var last = $('#main div.slide').length; //Needed for the next/prev buttons var next; //Set the first div to the front, and variable for first div var $active = $('#main div.slide[title='+first+']'); //Hide the links until the div is hovered over and take them away when mouse leaves $('#main').children('a').hide(); $('#main').mouseenter(function() { $('#main').children('a').fadeIn(750); }).mouseleave(function() { $('#main').children('a').fadeOut(750); }); $active.css('z-index', '4'); $('#main #next').click(function() { if ((next = parseInt($active.attr('title')) + 1) > last) { next = 1; } $active.css('z-index', '0').stop().animate({opacity: 0}, 1000); $active = $('#main div[title='+next+']').css('z-index', '4').stop().animate({opacity : 1}, 1000); }); });

    Read the article

  • How do I debug JavaScript .onlick event?

    - by user3700824
    I'm learning JavaScript but seem to be having a problem. I have a piece of code that is executed when the page is fully loaded. The function then gathers all the button elements on my HTML page. From here I loop through getting each button's title attribute and then assign an onclick event to the button that is equal to a function that writes to the console.log with the title. I have tried various ways of doing this but it is not working. Here is the JavaScript code that I'm working with. Currently all it does is loop through calling the function and logging the tile to the console.log, but this is not supposed to happen. Each time I click the button it should call the function with its title and log that. window.onload = myPageIsReady; function myPageIsReady(){ var myList = document.getElementsByTagName("button"); var myTitle = []; for(var i = 0; i < myList.length; i++){ myTitle[i] = myList[i].getAttribute("title"); myList[i].onclick = getMyTitle(myTitle[i]); }; function getMyTitle(myTitle){ console.log(myTitle); }; };

    Read the article

  • Linq Scope Problem + Reduce Repeated Code

    - by Tom Gullen
    If the parameter is -1, it needs to run a different query as to if an ID was specified... how do I do this? I've tried initialising var q; outside the If block but no luck! // Loads by Entry ID, or if -1, by latest entry private void LoadEntryByID(int EntryID) { IEnumerable<tblBlogEntry> q; if (EntryID == -1) { q = ( from Blog in db.tblBlogEntries orderby Blog.date descending select new { Blog.ID, Blog.title, Blog.entry, Blog.date, Blog.userID, Comments = ( from BlogComments in db.tblBlogComments where BlogComments.blogID == Blog.ID select BlogComments).Count(), Username = ( from Users in db.yaf_Users where Users.UserID == Blog.userID select new { Users.DisplayName }) }).FirstOrDefault(); } else { q = ( from Blog in db.tblBlogEntries where Blog.ID == EntryID select new { Blog.ID, Blog.title, Blog.entry, Blog.date, Blog.userID, Comments = ( from BlogComments in db.tblBlogComments where BlogComments.blogID == Blog.ID select BlogComments).Count(), Username = ( from Users in db.yaf_Users where Users.UserID == Blog.userID select new { Users.DisplayName }) }).SingleOrDefault(); } if (q == null) { this.Loaded = false; } else { this.ID = q.ID; this.Title = q.title; this.Entry = q.entry; this.Date = (DateTime)q.date; this.UserID = (int)q.userID; this.Loaded = true; this.AuthorUsername = q.Username; } } My main aim is to reduce repeating code

    Read the article

  • PHP active page code - I can't figure out parse error

    - by dmschenk
    I'm trying to build an active page menu with PHP and MySQL and am having a difficult time fixing the error. In the while statement I have an if statement that is giving me fits. Basically I think I'm saying that "thispage" is equal to the "title" based on pageID and as the menu is looped through if "thispage" is equal to "title" then echo id="active". Thanks <?php mysql_select_db($database_db_connection, $db_connection); $query_rsDaTa = "SELECT * FROM pages WHERE pagesID = 4"; $rsDaTa = mysql_query($query_rsDaTa, $db_connection) or die(mysql_error()); $row_rsDaTa = mysql_fetch_assoc($rsDaTa); $totalRows_rsDaTa = mysql_num_rows($rsDaTa); $query_rsMenu = "SELECT * FROM menu WHERE online = 1 ORDER BY menuPos ASC"; $rsMenu = mysql_query($query_rsMenu, $db_connection) or die(mysql_error()); $thisPage = ($row_rsDaTa['title']); ?> <link href="../css/MainStyle.css" rel="stylesheet" type="text/css" /> <h2><?php echo $thisPage; ?></h2> <div id="footcontainer"> <ul id="footlist"> <?php while($row_rsMenu = mysql_fetch_assoc($rsMenu)) { echo (" <li" . <?php if ($thisPage==$row_rsDaTa['title']) echo id="active"; ?> . "<a href=\"../" . $row_rsMenu['menuURL'] . "\">" . $row_rsMenu['menuName'] . "</a></li>\n"); } echo "</ul>\n"; ?> </div> <?php mysql_free_result($rsMenu); mysql_free_result($rsDaTa); ?>

    Read the article

  • SQLAlchemy sessions - DetachedInstanceError?

    - by benjaminhkaiser
    I have a function that attempts to take a list of usernames, look each one up in a user table, and then add them to a membership table. If even one username is invalid, I want the entire list to be rolled back, including any users that have already been processed. I thought that using sessions was the best way to do this but I'm running into a DetachedInstanceError: DetachedInstanceError: Instance <Organization at 0x7fc35cb5df90> is not bound to a Session; attribute refresh operation cannot proceed Full stack trace is here. The error seems to trigger when I attempt to access the user (model) object that is returned by the query. From my reading I understand that it has something to do with there being multiple sessions, but none of the suggestions I saw on other threads worked for me. Code is below: def add_members_in_bulk(organization_eid, users): """Add users to an organization in bulk - helper function for add_member()""" """Returns "success" on success and id of first failed student on failure""" session = query_session.get_session() session.begin_nested() users = users.split('\n') for u in users: try: user = user_lookup.by_student_id(u) except ObjectNotFoundError: session.rollback() return u if user: membership.add_user_to_organization( user.entity_id, organization_eid, '', [] ) session.flush() session.commit() return 'success' here's the membership.add_user_to_organization: def add_user_to_organization(user_eid, organization_eid, title, tag_ids): """Add a User to an Organization with the given title""" user = user_lookup.by_eid(user_eid) organization = organization_lookup.by_eid(organization_eid) new_membership = OrganizationMembership( organization_eid=organization.entity_id, user_eid=user.entity_id, title=title) new_membership.tags = [get_tag_by_id(tag_id) for tag_id in tag_ids] crud.add(new_membership) and here is the lookup by ID query: def by_student_id(student_id, include_disabled=False): """Get User by RIN""" try: return get_query_set(include_disabled).filter(User.student_id == student_id).one() except NoResultFound: raise ObjectNotFoundError("User with RIN %s does not exist." % student_id)

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >