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

  • Home
  • SEARCH
  • 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 7218907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:32:51+00:00 2026-05-28T21:32:51+00:00

My website project includes taking data from the user in the form of two

  • 0

My website project includes taking data from the user in the form of two input fields. These fields are a starting location and a destination on a map.

First problem arises here; the user must click a button to submit the input fields instead of just hitting enter. Found solution here: I need help submitting a form. I do not want the page to refresh, and I do not know how to accomplish this

If the user then decides that they want to change either location, they first have to refresh the page and start over. This is where the second problem arises; most users (read: all users) don’t want to have to refresh just to change something small like this.

How can I get it so that enter will submit the data, and how can I make it so that the inputs can be changed without having to refresh?

This project uses Google Maps to map out the start location, destination, the route, as well as certain checkpoints.

If you would like to view the project as it is now, please visit: http://ec2-107-22-36-152.compute-1.amazonaws.com/ProjectAlpha/BOJEMI_Travels.html

  • 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-28T21:32:52+00:00Added an answer on May 28, 2026 at 9:32 pm

    I’ll answer what I can:

    To capture the “enter” keypress, you would do something like this:

    $("input").keypress(function(e){
        if(e.which == 13){
            $("input[type=submit]").trigger('click');
        }
    });
    

    In terms of the issue with refreshing the directions, I’m now getting a JS error:

    markerArray[i] is undefined
    http://ec2-107-22-36-152.compute-1.amazonaws.com/ProjectAlpha/BOJEMI_Travels.html
    Line 108
    

    Looking at your code, you are using the following structure:

    for (i = 0; i < markerArray.length; i++) {
        markerArray[i].setMap(null);
    } 
    

    I don’t know if this will solve the problem or not, but you might try the following syntax for your “for loop”:

    for (var i in markerArray) {
        markerArray[i].setMap(null);
    } 
    

    In the version you have, you are assuming that all indice names will be in order, when they may not be. In my version, i only gets set to actual indice names as the value for i. I don’t know if that will solve the problem as a whole, but it will certainly fix the JS error that I was getting at the time, and I have a hunch that will let the rest of your code execute gracefully.

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

Sidebar

Related Questions

I've got a website project under version control that relies on files from an
I have a website project which includes several assemblies which are built separately. One
yesterday I deployed my website from c:\development\project\ to c:\inetpub\wwwroot\virtualdir\ (same pc). It worked for
I have a Website project that I'm trying to debug using Fiddler. Fiddler doesn't
I have a website project that I want to build using CruiseControl.net. On one
I am working with asp.net website project that some of pages need authentication. I
I have a C# solution with a website project and a C# library. When
I am converting an older C# Website Project into a Web Application Project so
I've got this ASP.NET 2.0 website project in Visual Studio that I've been working
A number of team members update a central ASP.NET dev Website project, not a

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.