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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:23:12+00:00 2026-06-12T15:23:12+00:00

I am developing a mobile application with jquery mobile and html5. One Part of

  • 0

I am developing a mobile application with jquery mobile and html5. One Part of the application is an event calendar which should have the possibility to iterate through the months by clicking on the next and previous buttons.

The iterating function works without problems, but when the month has been changed, the button’s content and functions should be updated to display the previous and next buttons of the new month.

if (month == 11) {
  var next_month = '<input id="next" onclick = "callMonth(' + 0 + ',' + (year + 1) 
    + ');" type="button" data-icon="arrow-r" data-inline="true" value="' 
    + monthNames[0] + ' ' + (year + 1) + '" />';
} else {
  var next_month = '<input id="next" onclick="callMonth(' + (month + 1) + ',' 
    +  year + ');" type="button" data-icon="arrow-r" data-inline="true" value="' 
    + monthNames[month + 1] + ' ' + (year) + '" />';    
}

// previous month
if (month == 0) {
  var prev_month = '<input id="next" onclick = "callMonth(' + 11 + ',' 
    + (year - 1) + ');" type="button" data-icon="arrow-l" data-inline="true" value="'
    + monthNames[11] + ' ' + (year - 1) + '" />';
} else {
  var prev_month = '<input id="next" onclick="callMonth(' + (month - 1) + ',' 
    + year + ');" type="button" data-icon="arrow-l" data-inline="true" value="' 
    + monthNames[month - 1] + ' ' + (year) + '" />';
}

I am using the onclick parameter of the input button, because the jQuery mobile function $("#next").click() is not working inside of the if-else-block. It’s also important to mention that the function callMonth(y,m) itself will call this code. The code displayed above is part of the function calendarWidget() which is being called by the function callMonth(). So the onclick parameter function triggers the function that builds the button again.

Now to my problem: the first time the button is generated, it has the correct style that it should have (jQuery mobile, next/prev icons). When the button is clicked – no matter if previous or next – the next or previous month is displayed correctly with all of its contents. The problem is: the button resets its style to the browser’s default, that means no jQuery mobile ui, no icons. As indicated before, the functionality update works with no problems that means it is possible to continue iterating through the months.

How can i prevent the changing of the button’s style? How should i implement the button’s functionality (without reloading the page?)

I am sorry for my lack of experience in jQuery mobile and English. I couldn’t find any sources to document this error, maybe the problem is the use of the onclick but it is not possible to define the click-event-trigger inside of the if-else-statement. I would gladly appreciate any hints, helps or clues on how to solve this problem.

Thanks a lot in advance!

  • 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-12T15:23:14+00:00Added an answer on June 12, 2026 at 3:23 pm

    Well since there hasn’t been enough detail on my problem or maybe because it has been too specific, I couldn’t find a simple solution and now I have written a simple workaround to fix the problem.
    I already tried to call .trigger("create") with the two buttons, after the change has been made, but it wouldn’t work. So I simply added a page reload after all changes have been done:

    var callMonth = function(m, y) {
        $("#calendar").calendarWidget({month: m, year:y});
         eventData = eventFeedReader.read(function(eventData) {
                    evalCalendar(m, y, eventData);
                });
        $('#events').page('destroy').page();
        }
    

    The callMonth-Function is still being called by the onclick-parameter of the button:

    <input id="next" onclick="callMonth(' + (month + 1) + ',' 
        +  year + ');" type="button" data-icon="arrow-r" data-inline="true" value="' 
        + monthNames[month + 1] + ' ' + (year) + '" />';    
    

    so no changes here.

    Even though I expected that the command .page("destroy").page() would also undo all the changes that have been made to the calendar widget, it didn’t. The content and the functionalities are working fine after the page has been destroyed and rebuilt. I don’t know why it was impossible to trigger a recreation of the buttons but anyhow – now everything works fine.
    Anyway thanks to everyone who has tried to guess a solution and good luck to those who stumble upon this while having a similar problem!

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

Sidebar

Related Questions

I am developing one Iphone application using jquery mobile + HTML5. I can check
I am developing HTML5, jQuery mobile application. I have to use 3rd party JSON
I am developing a mobile application using phonegap and jquery mobile. I have this
I am developing a PhoneGap application with JQuery mobile which requires geolocation data. Currently
I am developing an Application with jQuery Mobile and Phonegap. I want to have
I am developing a mobile application and I have a click function in jQuery
I am developing the application using jQuery Mobile 4.1. In my app, I have
I'm developing a JQuery Mobile application which loads from two different domains. (some pages
I'm developing a mobile application using jQuery. On Microsoft Azure, I have an Asp.Net
I am developing an Phonegap & jQuery-Mobile Application for Android. After taking a photo

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.