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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:58:47+00:00 2026-06-05T05:58:47+00:00

Background: I’m developing an ecommerce site in jQuery Mobile (JQM). I’ve created a product

  • 0

Background:

I’m developing an ecommerce site in jQuery Mobile (JQM). I’ve created a product page that lists all products in a particular category utilizing JQM’s Split Button Listview attribute.

Here is my working code:

<ul data-role="listview" data-inset="true" data-split-icon="plus" data-split-theme="d"         data-theme="d" data-dividertheme="d">
<li data-role="list-divider" class="listdivider">SPI_Level3Entry</li>
<!-- SPI_HTML_Product_Entry1 -->
<li class="prod"><a href="SPI_ProdFullLink" onmouseover="window.status=''; return     true;" rel="SPI_ProdThumbnail"><img src="SPI_ProdThumbnail" alt="SPI_ProdEntryDesc"/>
<!-- SPI_HTML_Product_LinkItemNum -->
<h2>SPI_ProdEntryID</h2>
<!-- SPI_HTML_Product_LinkItemNum -->
<!-- SPI_HTML_Product_Entry_Others -->
<p class="space"><b>
<!-- SPI_HTML_Product_ColHdr_PNs -->
SPI_ColHdrOther</b>
<!-- SPI_HTML_Product_ColHdr_PNs -->
: SPI_ProdEntryOther</p>
<!-- SPI_HTML_Product_Entry_Others -->
<p class="description"><b>Description</b>: SPI_ProdEntryDesc</p>
<!-- SPI_HTML_AllowOrderPlacement -->
<!-- SPI_HTML_AllowViewPriceAvail -->
<p class="space"><b>Qty Avail</b>: SPI_ProdQtyAvail</p>
<p class="space"><b>Unit Price</b>: <span class="price">SPI_ProdEntryPrice</span></p>
<!-- SPI_HTML_AllowViewPriceAvail -->

<input name="SPI_CartProductIDFieldName" type="hidden" value="SPI_ProductID" />
<input name="SPI_CartMfgProdIDFieldName" type="hidden" value="SPI_MfgProdID" />
<input name="SPI_CartProductDescFieldName" type="hidden" value="SPI_ProductDesc" />
<input type="number" name="SPI_CartOrdQtyFieldName" class="nolink" value="0" />

</a>
<a href="#" onClick="javascript:if (document.AddItem.SPI_CartOrdQtyFieldName.value==0)    {document.AddItem.SPI_CartOrdQtyFieldName.value='1'};document.AddItem.submit();">Add</a>
<!-- SPI_HTML_AllowOrderPlacement -->
</li>
</ul>

The Problem

As you can see, the contents of each li is wrapped in an “a href” attribute. Within the “a href” attribute, I have a text input. The problem is, when I click the text input to enter a value, the default “a href” behavior results.

The Question

How do I prevent the default “a href” behavior on the text input in JQM while retaining the default “a href” behavior on the rest of the li content?

  • 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-06-05T05:58:48+00:00Added an answer on June 5, 2026 at 5:58 am

    You can prevent default behavior by calling preventDefault() on the event object.

    example:

    $('a').click(function(event){
        event.preventDefault();
        //also possible
        event.stopImmediatePropagation();
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background This is only my second PyQt4 project. Developing a Windows app that has
Background I have a basic HTML page with an iframe that points to a
Background: At my company we are developing a bunch applications that are using the
Background: I am developing a web-based teaching program (using Drupal 7, if that matters)
Background Hi All, I'm trying to use Boost::MPI, at the moment I'm just trying
Background: I am developing an app which sends an SMS to users after registration
Background: I have a css and a js that is used only by the
Background I graduated 6 months ago, and my collaborative work in college has all
Background: My employeer at my non-programming job knows that I am an undergraduate CS
Background: I'm building a poetry site with user submitted content. The relevant user actions

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.