Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7185217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:22:05+00:00 2026-05-28T18:22:05+00:00

OK so I just started using sammy.js , I don’t it very well but

  • 0

OK so I just started using sammy.js , I don’t it very well but I was able to get the basics working pretty quickly.
HTML form I’m using

<form id="contact_form" action="#/form" method="post">
<label for="name">Name:</label><input  class="textbox" type="text" name="name" id="name" />
<label for="email">E-mail:</label><input  class="textbox" type="text" name="email" id="email" />
<label for="message">Message:</label><textarea class="textbox" name="message"  id="message"></textarea>
<button type="submit" name="submit" value="Submit" id="submit" />
<p id="message_outcome"></p>

js I’m Using to route my urls

var app = $.sammy(function(){
    this.element_selector = '#page1';
    this.get('#/about',function(context){
        $("ul#nav li").removeClass("active"); //removes "active" class
        $('#nav_1').addClass("active"); //adds "active" class to the tab that is selected
        $.post('home/about','', function(resp){
            $('#page1').html(resp);
            $('#page_container').cycle(0); //the number of the div that will be shown on click
        });
    });

    this.post('#/form', function(context){
       this.log('Form Submission');

    });
});


$(function(){
    app.run('#/about');
});

When the url has #/form in it, I get a console log that says its running route get(‘#/form’) .. any ideas?

Here is some more information that may help

Jquery Plugin I’m using aside from sammy

http://jquery.malsup.com/cycle/

This is what my chrome console says when I click submit on my form.
[Sun Oct 10 2010 05:29:27 GMT-0400 (Eastern Daylight Time)] runRoute get #/form /public/js/lib/sammy.js:96
[Sun Oct 10 2010 05:29:27 GMT-0400 (Eastern Daylight Time)] 404 Not Found get #/form Error: 404 Not Found get #/form

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:22:06+00:00Added an answer on May 28, 2026 at 6:22 pm

    Another thing to keep in mind for post routes is to understand how sammy works. When Sammy is initialized it gets bounded to a jQuery selector.

    var app = $.sammy('#content', function() {
       ...
    });
    

    For post routes, Sammy binds to all the forms inside the selector used for initializing (#content in our example) the application and listens for the click events generated by form submit as these gets bubbled up to the parent. Now, when it sees the submit event for form it will execute the corresponding route if the form points to a route.

    On thing to keep in mind is that if your form is outside the main selector (e.g. in header which is outside #content) then sammy will never receive the submit event and post route will never execute.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using SVN, and I have a cache directory that I don't
I just started using Selenium 2 tonight so this will be very basic (I
I just started using FPC to practice more my old knowledge of Pascal, but
Just started using log4net and trying to get my head around the config and
Just started using fadein/fadeout - it's functioning but with problems. I have a set
Just started using App Engine's webapp framework, but I can't figure out what's wrong
Just started using Blueprint CSS and now playing with the grids but have a
I just started using Datamapper. I am trying to update an object. I get
I just started using GIT yesterday and i was trying to do something but
I just started using SciTE and I really like it, but at the moment

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.