Solved

JQuery Values being lost on submit

Posted on 2012-04-10
4
324 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 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