Solved

JQuery Values being lost on submit

Posted on 2012-04-10
4
321 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
Comment Utility
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
Comment Utility
Yes, to both of your questions.
0
 

Author Comment

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

Author Comment

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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now