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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:42:19+00:00 2026-06-05T07:42:19+00:00

I’m doing mobile website based on JQM and http://dl.dropbox.com/u/49735179/dialog-data-transfer.html . If click submit button

  • 0

I’m doing mobile website based on JQM and http://dl.dropbox.com/u/49735179/dialog-data-transfer.html .

If click submit button from one of search result on section “dialogPage”,
It supposed to be shown on section “mainPage” of zip1, zip2, addr form.

But the form value of zip_code1, zip_code2, addr
are not tranfered to section “mainPage”.

What is the problem in this script?

Here is full script + html.

<!DOCTYPE html> 
<html> 
<head>
<title>Test Dialog</title>
<meta charset="utf-8" />
<meta name="viewport" content="height=device-height,width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head> 

<body> 

<script>

$(document).ready(function() {
$('form').submit(function(){
var inputVal1 = $('input[name=zip_code1]').val();
var inputVal2 = $('input[name=zip_code1]').val();
var inputVal3 = $('input[name=addr]').val();
$("#mainPage").data("inputVal1", inputVal1);
$("#mainPage").data("inputVal2", inputVal2);
$("#mainPage").data("inputVal3", inputVal3);

})
});
$('#mainPage').live('pageshow', function(){
var inputVal1 = $(this).data('inputVal1') ? $(this).data('inputVal1') : "<? $defaultValue1 ?>";
var inputVal2 = $(this).data('inputVal2') ? $(this).data('inputVal2') : "<? $defaultValue2 ?>";
var inputVal3 = $(this).data('inputVal3') ? $(this).data('inputVal3') : "<? $defaultValue3 ?>";

$('div input[name=zip1]').val(inputVal1);
$('div input[name=zip2]').val(inputVal2);
$('div input[name=addr]').val(inputVal3);
});

</script>




<section id="mainPage" data-role="page">
<header data-role="header"><h1>Header</h1></header>
<div data-role="content">
<div>
<input type="text" name="zip1" value="">-<input type="text" name="zip2" value="">
<input type="text" name="addr" value="">
</div>

<a href="#dialogPage" data-role="button" data-transition="pop">Open Dialog</a>
</div>
<footer data-role="footer"><h1>Footer</h1></footer>
   </section>

   <!-- ## DIALOGS ## -->
   <section id="dialogPage" data-role="dialog" data-theme="d">
<header data-role="header"><h1>Header</h1></header>
<div data-role="content">
<h3>Input Dialog</h3>

<INPUT type="text" autocomplete="off" value="" id="k"><input type="submit" value="search" onClick="kin()" data-role="button">           
<DIV id="serverMsg"></DIV>      

           <form>
            <input type=hidden name=zip_code1 value='code1'>
            <input type=hidden name=zip_code2 value='code2'>
            <input type=hidden name=addr value='address1'>
            <table><tr>
            <td width=50>code1 - code2</td>
            <td>address1</td>
          </tr></table>
          <input type="submit" value='address1' /> 
          </form>

           <form>
            <input type=hidden name=zip_code1 value='code4'>
            <input type=hidden name=zip_code2 value='code5'>
            <input type=hidden name=addr value='address2'>
            <table><tr>
            <td width=50>code4 - code5</td>
            <td>address2</td>
          </tr></table>
          <input type="submit" value='address2' /> 
          </form>

           <form>
            <input type=hidden name=zip_code1 value='code6'>
            <input type=hidden name=zip_code2 value='code7'>
            <input type=hidden name=addr value='address2'>
            <table><tr>
            <td width=50>code6 - code7</td>
            <td>address3</td>
          </tr></table>
          <input type="submit" value='address3' /> 
          </form>              

    </div>

</div>
<footer data-role="footer"></footer>
  </section>

  </body>
  </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-06-05T07:42:20+00:00Added an answer on June 5, 2026 at 7:42 am

    use attr method, data() method does not create a data attribute;

    $(document).ready(function() {
    $('form').submit(function(){
    var inputVal1 = $('input[name=zip_code1]').val();
    var inputVal2 = $('input[name=zip_code1]').val();
    var inputVal3 = $('input[name=addr]').val();
    $("#mainPage").attr("data-inputVal1", inputVal1);
    $("#mainPage").attr("data-inputVal2", inputVal2);
    $("#mainPage").attr("data-inputVal3", inputVal3);
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
i got an object with contents of html markup in it, for example: string
I want to construct a data frame in an Rcpp function, but when I

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.