Uncategorized

Using val() in jquery to lookup data from a input box according to what’s is selected from

It adds the data to the html contact field below according to what is selected from the customer field. But when I save the data it saves what is in the contact field in the customer field also. How can I stop this from happening.
All the scripts below worked just fine until I added the first one below
This is the jquery script I am using
function updateValue(){  $(‘#contact’).val($(‘#customer’).val());}//update once the page has loaded too$(document).ready(function () {  updateValue();});Here is the two html fields that are being used
The falling script are how the drop down gets its data for the customer field
$( document ).ready(function() {$.ajax({  //create an ajax request to load_page.php  type: “GET”,  url: “signing.php”,  dataType: “html”,  //expect html to be returned  success: function(response){     $(“.responsesign”).html(response);   //alert(response);  }  }); });<?phpinclude("connect.php");$id = $_SESSION['profile']['id'];echo "“;foreach($db->query(“SELECT * FROM signings WHERE pid = ‘$id’ AND done = 0”) as $row) {   echo ““; }This is the ajax script that sends the data to the php script to save the data from the form
// JavaScript Document$(“#sub”).click( function(event) { //stop the click event from bubbling  event.preventDefault(); $.post( $(“#myForm”).attr(“action”),   $(“#myForm :input”).serializeArray(),   function(info){ $(“#result”).html(info);  return false; // at end    }); clearInput();}); $(“#myForm”).submit( function() {  return false; }); function clearInput() { $(“#myForm :input”).each( function() {  $(this).val(”); });}