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 6616543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:35:44+00:00 2026-05-25T20:35:44+00:00

I have a form where a user can enter a page title into an

  • 0

I have a form where a user can enter a page title into an input field and it will generate a URL. On the submit button click the value is displayed in a different input field(URL). If they are not happy with their URL they can manually edit it inside that field and then save their changes via a button click.

The button’s value also changes depending on the state of the URL field.

My code is working but I have a problem with the last 2 functions happening at once, I have tried adding StopEventPropagation (or similar) and that has not worked for me. Please help if you can.

The JSfiddle is here

  • 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-25T20:35:44+00:00Added an answer on May 25, 2026 at 8:35 pm

    Rather than combining both handlers I used jQuerys live event handler for the second click.

    $("input#page_url_button.edit_url_button").live('click', function () {
          alert("2");
          $(this).val("Save");
          $("input#page_url").removeAttr("disabled");
          $(this).removeClass("edit_url_button");
          $(this).addClass("save_url_button");
    });
    

    See example at http://jsfiddle.net/dJPvJ/

    Edit:

    I was half-way there with my original answer, this amended code should do what you need:

    // If URL has info in it, then change value of button and add class to button
    $("input#page_url_button.save_url_button").live('click', function () {
    if( $("input#page_url").val().length > 0 ) {
          $(this).val("Edit URL");
          $(this).addClass("edit_url_button");
    }
    }); // This part is getting skipped, I need to find a way to include this in the process
    
    
    // If this button has class (edit_button_url) change value, add new class and remove the Dsiabled attr from URL field
    $("input#page_url_button.edit_url_button").live('click', function () {
          $(this).val("Save");
          $("input#page_url").removeAttr("disabled");
          $(this).removeClass("edit_url_button");
          $(this).addClass("save_url_button");
    });
    

    To get this to work you also need to add “save_url_button” to the original markup:

    <input id="page_url_button" type="button" value="Submit" class="save_url_button fright" style="width:60px">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form a user can enter their name, then it will add
I have a very small form where a user can enter their zip code
On a website if I have a form where the user can input some
I have form where user submits field. Field can have letters, numbers, and punctuation.
In my form I have a set of input boxes where a user can
I have designed a form where the user can enter his comment using Add
I have a dashboard page where the user can enter an asset code or
I have a JSF page where users can enter their car into my database.
I have a form where the user can upload a zip file, it works
I have a form in which the user can choose a component type from

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.