Solved

JQuery Values being lost on submit

Posted on 2012-04-10
4
331 Views
Last Modified: 2012-04-11
The code below successfully populates the fields with the results of the JSON request.  The problem is that when I submit the form to insert into the database the fields are wiped and I get null values.  What am I doing wrong?  Thanks!


 $('.address-result').live('click', function (event) {
		            // Put the selected address data in the result div (you could do whatever you want here)
		            $('#dialog').dialog('close');
		            var raw = $(this).find('.complete-address').html();
		            var json = JSON.parse(raw);
                  
		            $("#txtLat").val(json["metadata"]["latitude"]); // This Display in text box
		            $("#txtLong").val(json["metadata"]["longitude"]);
//		            $("#txtPrecision").val(json["metadata"]["percision"]);
		            $("#txtCounty").val(json["metadata"]["county_name"]);
		            $("#txtRDI").val(json["metadata"]["rdi"]);
		            $("#txtVacant").val(json["analysis"]["dpv_vacant_code"]);
		        });
		    });

Open in new window

0
Comment
Question by:rcowen00
  • 3
4 Comments
 
LVL 23

Accepted Solution

by:
basicinstinct earned 500 total points
ID: 37830293
just before you submit the form take a look at the html... (F12 in Google Chrome)

are your inputs inside the same html form as the submit button?
do your inputs all have name and value attributes set?
0
 

Author Comment

by:rcowen00
ID: 37833669
Yes, to both of your questions.
0
 

Author Comment

by:rcowen00
ID: 37833683
The problem is with the stored procedure.  I just realized that one of the fields is inserting as expected.
0
 

Author Comment

by:rcowen00
ID: 37833872
It was not a problem with the stored procedure but the settings on the field.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question