473,480 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Autofill form fields, almost working

769 Contributor
Hey Everyone,

Well after asking many questions i have this almost working.

This is how it works. Basically i fill in my customer number field an that populates my drop down box. Once i select an option from the drop down box it populates the rest of the form. The problem i am having is that if a customer number doesn't exist in the drop down box an i try to put a new customer number in the input say 538 an then click on another field such as first name i get an error saying Object expected. An well i can't figure out why its saying that. An could really use some help as to why i am getting this error.

i started a topic earlier about this which you can see here. don't know if this will help in anyway but thought i would post it anyway.
http://bytes.com/forum/showthread.ph...05#post3315805

here is my form
Expand|Select|Wrap|Line Numbers
  1. Customer Number*:<input type="text" name="custnum" id="clientID" value=""  ONKEYUP="autoComplete(this,this.form.options,'value',false)"  onChange="validate(this.form.custnum,'Customer Number')"/>
  2. <SELECT NAME="options" id="options"
  3. onChange="this.form.custnum.value=this.options[this.selectedIndex].value;javascript:initFormEvents();">
  4. <cfoutput query="getcustnum">
  5. <option value="#fk_custNum#">#fk_custNum#</option>
  6. </cfoutput>
  7. </SELECT>
  8. First name: <input type="text" name="fname" id="fname" value="" size="20"/>
here is the javascript that appears on my form.
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE="JavaScript" SRC="autocomplete.js"></SCRIPT>
  2.     <script type="text/javascript" src="ajax.js"></script>
  3.     <script type="text/javascript">
  4.  
  5. var ajax = new sack();
  6.     var currentClientID=false;
  7.     function getClientData()
  8.     {
  9.         var clientId = document.getElementById('clientID').value;
  10.             currentClientID = clientId
  11.             ajax.requestFile = 'getClient.cfm?custnum='+clientId;    // Specifying which file to get
  12.             ajax.onCompletion = showClientData;    // Specify function that will be executed after file has been found
  13.             ajax.runAJAX();        // Execute AJAX function            
  14.  
  15.     }
  16.  
  17.     function showClientData()
  18.     {
  19.         var formObj = document.forms['page1'];    
  20.         eval(ajax.response);
  21.     }
  22.  
  23.  
  24.     function initFormEvents()
  25.     {
  26.         document.getElementById("options").onchange = getClientData;
  27.     }
  28.  
  29.     window.onload = initFormEvents;
  30.     </script>
  31.  
heres whats on my autocomplete.js file
Expand|Select|Wrap|Line Numbers
  1. function autoComplete (field, select, property, forcematch) {
  2.     var found = false;
  3.     for (var i = 0; i < select.options.length; i++) {
  4.     if (select.options[i][property].toUpperCase().indexOf(field.value.toUpperCase()) == 0) {
  5.         found=true; break;
  6.         }
  7.     }
  8.     if (found) { select.selectedIndex = i; }
  9.     else { select.selectedIndex = -1; }
  10.     if (field.createTextRange) {
  11.         if (forcematch && !found) {
  12.             field.value=field.value.substring(0,field.value.length-1); 
  13.             return;
  14.             }
  15.         var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;";
  16.         if (cursorKeys.indexOf(event.keyCode+";") == -1) {
  17.             var r1 = field.createTextRange();
  18.             var oldValue = r1.text;
  19.             var newValue = found ? select.options[i][property] : oldValue;
  20.             if (newValue != field.value) {
  21.                 field.value = newValue;
  22.                 var rNew = field.createTextRange();
  23.                 rNew.moveStart('character', oldValue.length) ;
  24.                 rNew.select();
  25.                 }
  26.             }
  27.         }
  28.     }
here what appears on my ajax.js file

Expand|Select|Wrap|Line Numbers
  1. function sack(file) {
  2.     this.xmlhttp = null;
  3.  
  4.     this.resetData = function() {
  5.         this.method = "POST";
  6.           this.queryStringSeparator = "?";
  7.         this.argumentSeparator = "&";
  8.         this.URLString = "";
  9.         this.encodeURIString = true;
  10.           this.execute = false;
  11.           this.element = null;
  12.         this.elementObj = null;
  13.         this.requestFile = file;
  14.         this.vars = new Object();
  15.         this.responseStatus = new Array(2);
  16.       };
  17.  
  18.     this.resetFunctions = function() {
  19.           this.onLoading = function() { };
  20.           this.onLoaded = function() { };
  21.           this.onInteractive = function() { };
  22.           this.onCompletion = function() { };
  23.           this.onError = function() { };
  24.         this.onFail = function() { };
  25.     };
  26.  
  27.     this.reset = function() {
  28.         this.resetFunctions();
  29.         this.resetData();
  30.     };
  31.  
  32.     this.createAJAX = function() {
  33.         try {
  34.             this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  35.         } catch (e1) {
  36.             try {
  37.                 this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  38.             } catch (e2) {
  39.                 this.xmlhttp = null;
  40.             }
  41.         }
  42.  
  43.         if (! this.xmlhttp) {
  44.             if (typeof XMLHttpRequest != "undefined") {
  45.                 this.xmlhttp = new XMLHttpRequest();
  46.             } else {
  47.                 this.failed = true;
  48.             }
  49.         }
  50.     };
  51.  
  52.     this.setVar = function(name, value){
  53.         this.vars[name] = Array(value, false);
  54.     };
  55.  
  56.     this.encVar = function(name, value, returnvars) {
  57.         if (true == returnvars) {
  58.             return Array(encodeURIComponent(name), encodeURIComponent(value));
  59.         } else {
  60.             this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
  61.         }
  62.     }
  63.  
  64.     this.processURLString = function(string, encode) {
  65.         encoded = encodeURIComponent(this.argumentSeparator);
  66.         regexp = new RegExp(this.argumentSeparator + "|" + encoded);
  67.         varArray = string.split(regexp);
  68.         for (i = 0; i < varArray.length; i++){
  69.             urlVars = varArray[i].split("=");
  70.             if (true == encode){
  71.                 this.encVar(urlVars[0], urlVars[1]);
  72.             } else {
  73.                 this.setVar(urlVars[0], urlVars[1]);
  74.             }
  75.         }
  76.     }
  77.  
  78.     this.createURLString = function(urlstring) {
  79.         if (this.encodeURIString && this.URLString.length) {
  80.             this.processURLString(this.URLString, true);
  81.         }
  82.  
  83.         if (urlstring) {
  84.             if (this.URLString.length) {
  85.                 this.URLString += this.argumentSeparator + urlstring;
  86.             } else {
  87.                 this.URLString = urlstring;
  88.             }
  89.         }
  90.  
  91.         // prevents caching of URLString
  92.         this.setVar("rndval", new Date().getTime());
  93.  
  94.         urlstringtemp = new Array();
  95.         for (key in this.vars) {
  96.             if (false == this.vars[key][1] && true == this.encodeURIString) {
  97.                 encoded = this.encVar(key, this.vars[key][0], true);
  98.                 delete this.vars[key];
  99.                 this.vars[encoded[0]] = Array(encoded[1], true);
  100.                 key = encoded[0];
  101.             }
  102.  
  103.             urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
  104.         }
  105.         if (urlstring){
  106.             this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
  107.         } else {
  108.             this.URLString += urlstringtemp.join(this.argumentSeparator);
  109.         }
  110.     }
  111.  
  112.     this.runResponse = function() {
  113.         eval(this.response);
  114.     }
  115.  
  116.     this.runAJAX = function(urlstring) {
  117.         if (this.failed) {
  118.             this.onFail();
  119.         } else {
  120.             this.createURLString(urlstring);
  121.             if (this.element) {
  122.                 this.elementObj = document.getElementById(this.element);
  123.             }
  124.             if (this.xmlhttp) {
  125.                 var self = this;
  126.                 if (this.method == "GET") {
  127.                     totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
  128.                     this.xmlhttp.open(this.method, totalurlstring, true);
  129.                 } else {
  130.                     this.xmlhttp.open(this.method, this.requestFile, true);
  131.                     try {
  132.                         this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
  133.                     } catch (e) { }
  134.                 }
  135.  
  136.                 this.xmlhttp.onreadystatechange = function() {
  137.                     switch (self.xmlhttp.readyState) {
  138.                         case 1:
  139.                             self.onLoading();
  140.                             break;
  141.                         case 2:
  142.                             self.onLoaded();
  143.                             break;
  144.  
  145.                         case 3:
  146.                             self.onInteractive();
  147.                             break;
  148.                         case 4:
  149.                             self.response = self.xmlhttp.responseText;
  150.                             self.responseXML = self.xmlhttp.responseXML;
  151.                             self.responseStatus[0] = self.xmlhttp.status;
  152.                             self.responseStatus[1] = self.xmlhttp.statusText;
  153.  
  154.                             if (self.execute) {
  155.                                 self.runResponse();
  156.                             }
  157.  
  158.                             if (self.elementObj) {
  159.                                 elemNodeName = self.elementObj.nodeName;
  160.                                 elemNodeName.toLowerCase();
  161.                                 if (elemNodeName == "input"
  162.                                 || elemNodeName == "select"
  163.                                 || elemNodeName == "option"
  164.                                 || elemNodeName == "textarea") {
  165.                                     self.elementObj.value = self.response;
  166.                                 } else {
  167.                                     self.elementObj.innerHTML = self.response;
  168.                                 }
  169.                             }
  170.                             if (self.responseStatus[0] == "200") {
  171.                                 self.onCompletion();
  172.                             } else {
  173.                                 self.onError();
  174.                             }
  175.  
  176.                             self.URLString = "";
  177.                             break;
  178.                     }
  179.                 };
  180.  
  181.                 this.xmlhttp.send(this.URLString);
  182.             }
  183.         }
  184.     };
  185.  
  186.     this.reset();
  187.     this.createAJAX();
  188. }
Thank you in advance,
Rach
Aug 26 '08
61 5240
bonneylake
769 Contributor
Hey Acoder,

Well i got another question involving the same topic an hope you wouldn't mind answering it.

I am working on now trying to redisplay information so that users can edit it. An well for some reason it is acting weird. when i pull up a ticket an you see all the contact information. When i go to submit it to go to the second page, when i get to the second page where i see the same exact information for some reason the customer number,city and notes fields will put space a little bit of space in front of the value. an the more editing i do to the same ticket the more space i am getting for those fields. The problem with that is every time that little bit of space is added it adds more contacts to my contacts table which i don't need. I have no clue whats causing this an was wondering if you had a suggestion?

Thank you,
Rach
Sep 16 '08 #51
acoder
16,027 Recognized Expert Moderator MVP
Have you made any changes to the code that you had in the two threads (this and the one in Coldfusion)? Post your latest relevant code.
Sep 16 '08 #52
bonneylake
769 Contributor
Have you made any changes to the code that you had in the two threads (this and the one in Coldfusion)? Post your latest relevant code.
Hey Acoder,

As far as i know i haven't made any real changes to it that would effect the city and customer notes, maybe the customer #

here is the javascript it is the same for both c1.cfm and c2.cfm.
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE="JavaScript" SRC="autocomplete.js"></SCRIPT>
  2.     <script type="text/javascript" src="autofill.js"></script>
  3.     <script type="text/javascript">
  4.  
  5. var ajax = new sack();
  6.     var currentClientID=false;
  7.     function getClientData()
  8.     {
  9.         var clientId = document.getElementById('clientID').value;
  10.         if (clientId != "") {
  11.             currentClientID = clientId
  12.             ajax.requestFile = 'getClient.cfm?custnum='+clientId;    // Specifying which file to get
  13.             ajax.onCompletion = showClientData;    // Specify function that will be executed after file has been found
  14.             ajax.runAJAX();        // Execute AJAX function            
  15.     }}
  16.  
  17.  
  18.  
  19.  
  20.     function showClientData()
  21.     {
  22.         var formObj = document.forms['page1'];
  23.         var resp = ajax.response.split(",");
  24.  
  25.       if (ajax.response == "") { // you may want to trim here just in case
  26.           formObj.cust_company.value = "";
  27.           formObj.fname.value = "";
  28.           formObj.lname.value = "";
  29.           formObj.add1.value = "";
  30.           formObj.city.value = "";
  31.           formObj.state.value = "";
  32.           formObj.zip.value = "";
  33.           formObj.email.value = "";
  34.           formObj.pri_phone.value = "";
  35.           formObj.sec_phone.value = "";
  36.           formObj.notes.value = "";
  37.  
  38.       } else {
  39.           var resp = ajax.response.split(",");
  40.           formObj.cust_company.value = resp[1];
  41.           formObj.fname.value = resp[2];
  42.           formObj.lname.value = resp[3];
  43.           formObj.add1.value = resp[4];
  44.           formObj.city.value = resp[5];
  45.           formObj.state.value = resp[6];
  46.           formObj.zip.value = resp[7];
  47.           formObj.email.value = resp[8];
  48.           formObj.pri_phone.value = resp[9];
  49.           formObj.sec_phone.value = resp[10];
  50.           formObj.notes.value = resp[11];
  51.       }
  52.     }
  53.         </script>
heres the coldfusion for c1.cfm and c2.cfm. the cfoutput query ticket is used to redisplay what was entered.
'
Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="ticket">
  2. Customer Number*:<input type="text" name="clientID" id="clientID" 
  3. value="#fk_customer_number#"  ONKEYUP="autoComplete(this,this.form.customer,'value',false)" size="20"/>
  4. <cfset fk_customer_number = #fk_customer_number#>
  5. </cfoutput>
  6. <SELECT NAME="customer" id="options"
  7. onChange="this.form.clientID.value=this.options[this.selectedIndex].value;"/>
  8. <option value="" selected></option>
  9. <cfoutput query="getcustnum">
  10. <option value="#fk_custNum#"<cfif #fk_custNum# is #fk_customer_number#>selected</cfif>>#fk_custNum#</option>
  11. </cfoutput>
  12. </SELECT>
  13. <input type="button" class="custnum" name="insert" value="Insert Contact" 
  14.  onclick="getClientData();"/>
  15. <cfoutput query="ticket">
  16. Company Name:<input type="text" name="compname" id="cust_company" value="#customer_company#" size="20"/>
  17. First Name:<input type="text" name="fname" id="fname" size="20" value="#customer_Fname#"/>
  18. Last Name:<input type="text" name="lname" id="lname" value="#customer_Lname#" size="20"/>
  19. Address:<input type="text" name="address" value="#customer_add1#" id="add1" size="20"/>
  20. City:<input type="text" name="city" id="city" value="#customer_city#" size="20"/>
  21. State:<input type="text" name="state" id="state" value="#customer_state#" size="20"/>
  22. Zip:<input type="text" name="zip" id="zip" value="#customer_zip#" size="20"/>
  23. Email Address:<input type="text" name="email" id="email" value="#customer_email#" size="20"/>
  24. Primary Phone:<input type="text" name="priphone" id="pri_phone"value="#customer_pri_phone#" size="20"/>
  25. Secondary Phone:<input type="text" name="secphone" id="sec_phone" value="#customer_sec_phone#" size="20"/>
  26. Customer Notes:
  27. <textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows="4" cols="60" name="custnotes" id="notes">#customer_notes#</textarea></cfoutput>
here is getclient.cfm
Expand|Select|Wrap|Line Numbers
  1. <cfparam name="url.custnum" default="">
  2.  
  3. <cfquery name="customerd" datasource="CustomerSupport">
  4.       select * from dbo.tbl_CS_contacts
  5.       where fk_custNum='#url.custnum#'
  6.       </cfquery>
  7.           <cfif url.custnum NEQ "" AND customerd.recordcount IS NOT 0> 
  8. <cfoutput query="customerd">#custnum#,#cust_company#,#fname#,#lname#,#add1#,#city#,#state#,#zip#,#email#,#pri_phone#,#sec_phone#,#notes#</cfoutput><cfelse></cfif>
There are only a few things that i notice. When i go to open up the page for edit. It will have space before the customer number,city and customer notes. The thing is when i am inserting you see no spaces or anything not on the first page or second page. When i go to the second page for edit (its exactly like the form i talked about previously). when i go to look at the edit on the second page it puts more space in front of those 3 fields an i got no clue why.

Thank you so much for the help,
Rach
Sep 17 '08 #53
bonneylake
769 Contributor
Hey Acoder,

Well i managed to fix the second page. Instead of the values being the names in the database i changed it to how i had it before which was "form.name of the field" and i was trying to do it "name of the field in database".

However, i am still having trouble with the first page an i am not sure how to fix it.
When i load the first page it still puts space for customer_number,city and notes.
The thing is with this i have to use the database names in order to get there values so i am not sure how to go around this.Any ideas?

Thank you :),
Rach
Sep 17 '08 #54
acoder
16,027 Recognized Expert Moderator MVP
When you mention about opening up a page for edit, is that another page?
Sep 17 '08 #55
bonneylake
769 Contributor
When you mention about opening up a page for edit, is that another page?
Hey Acoder,

Basically what i am doing with the form now is trying to make it where you can edit it. I made a copy of the form an just changed the name of it so i can use it for editing. when i go to select the ticket i want to edit when i click on it, it takes me to c1.cfm where i can see what was previously entered, which is the page that i am trouble with.

Heres all my pages

index.cfm is where you choose the ticket to edit.
c1.cfm is the first page where you see the ticket you are editing which shows all the contact information that was entered for that pacific ticket
c2.cfm is the second page where you see the contact information for a second time

the thing with c1.cfm the only way to display what was originally entered is by using the table field name like customer_number. before on the first page we did not give it values an now i am giving it values.

I hope this makes sense,

Rach
Sep 18 '08 #56
acoder
16,027 Recognized Expert Moderator MVP
When the space appears, is it when the page loads or after the auto-fill?
Sep 18 '08 #57
bonneylake
769 Contributor
When the space appears, is it when the page loads or after the auto-fill?
Hey Acoder,

the space appears when the page loads. When the page loads it shows what was typed in previously so theres no need to auto-fill unless there changing the customer. But i don't seem to have this trouble with any fields except customer number, city and notes so i am not sure why its only applying it to those 3, you would think it would happen to all.

but here is what i have on the first page. the only thing i changed was i added a value to each field.

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="ticket" datasource="CustomerSupport">
  2.         SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
  3. customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,customer_state,
  4. customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_notes,htpp FROM dbo.tbl_CS_ticketMaster
  5.         WHERE pk_ticketID = #URL.pk_ticketID#
  6. </cfquery>
  7.  
  8. <cfoutput query="ticket">
  9. Customer Number*:<input type="text" name="custnum" id="clientID" 
  10. value="#fk_customer_number#"  ONKEYUP="autoComplete(this,this.form.customer,'value',false)" size="20"/>
  11. <cfset fk_customer_number = #fk_customer_number#>
  12. </cfoutput>
  13. <SELECT NAME="customer" id="options"
  14. onChange="this.form.custnum.value=this.options[this.selectedIndex].value;"/>
  15. <option value="" selected></option>
  16. <cfoutput query="getcustnum">
  17. <option value="#fk_custNum#"<cfif #fk_custNum# is #fk_customer_number#>selected</cfif>>#fk_custNum#</option>
  18. </cfoutput>
  19. </SELECT>
  20. <input type="button" class="custnum" name="insert" value="Insert Contact" 
  21.  onclick="getClientData();"/>
  22. <cfoutput query="ticket">
  23. Company Name:<input type="text" name="compname" id="cust_company" value="#customer_company#" size="20"/>
  24. First Name:<input type="text" name="fname" id="fname" size="20" value="#customer_Fname#"/>
  25. Last Name:<input type="text" name="lname" id="lname" value="#customer_Lname#" size="20"/>
  26. Address:<input type="text" name="address" value="#customer_add1#" id="add1" size="20"/>
  27. City:<input type="text" name="city"  value="#customer_city#" id="city" size="20"/>
  28. State:<input type="text" name="state" id="state" value="#customer_state#" size="20"/>
  29. Zip:<input type="text" name="zip" id="zip" value="#customer_zip#" size="20"/>Email Address:<input type="text" name="email" id="email" value="#customer_email#" size="20"/>
  30. Primary Phone:
  31. <input type="text" name="priphone" id="pri_phone" value="#customer_pri_phone#" size="20"/>
  32. Secondary Phone:<input type="text" name="secphone" id="sec_phone" value="#customer_sec_phone#" size="20"/>
  33. Customer Notes:
  34. <textarea  maxlength='500' onkeyup='return ismaxlength(this)' onkeydown='return ismaxlength(this)' rows="4" cols="60" name="custnotes" id="notes">#customer_notes#</textarea>
  35. </cfoutput>
Thank you for the help,
Rach
Sep 18 '08 #58
acoder
16,027 Recognized Expert Moderator MVP
If it's appearing on page load, that means it can't be the JavaScript which is causing the problem (unless you're calling some JavaScript code onload). This seems like a Coldfusion problem.
Sep 18 '08 #59
bonneylake
769 Contributor
If it's appearing on page load, that means it can't be the JavaScript which is causing the problem (unless you're calling some JavaScript code onload). This seems like a Coldfusion problem.
Hey Acoder,

i was afraid it was a coldfusion problem. The weird thing that is happening with this is when i am inserting information into the table i have noticed these squares in front of the fields i add an its only for those 3 fields mentioned.But anyway this information for the contacts gets insert into 2 tables one called ticketMaster and the other called contacts. When it goes into contacts it inserts correctly an does not put any spaces in the fields. But when it goes into ticketMaster the 3 fields always seem to have space in them.

ok i just did a test on it (tested by inserting new records) an here is what i am getting

on the cticketpage1.cfm page
when i insert the first customer in the contacts it looks fine an in the ticketMaster it looks fine except in the customer_notes where it puts 2 squares in front of it although i made sure before inserting that it had no spaces an on the form instead it appears to have no spaces.

when i get to the second page an i click update (i have a part in my form that allows the users to update information). It then puts the spaces in front of customer_number, city and notes.this also happens when i click submit at the bottom of the page because they resubmit the information when they submit the form.

here is what is on the page when i first submit the form for the first time

Expand|Select|Wrap|Line Numbers
  1. <!---Inserts record into ticketmaster table--->
  2. <cfquery name="insertticketmaster" datasource="CustomerSupport">
  3.     exec usp_CS_InsertticketMaster '#Form.title#','#Form.priority#','#Form.status#','#Form.submitted_by#','#Form.last_edited_by#',
  4.     '#Form.clientID#','#Form.compname#','#Form.fname#',
  5.   '#Form.lname#','#Form.address#','#Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','
  6.     #Form.custnotes#','#Form.costcenterid#','#Form.htpp#'
  7. </cfquery>
  8.  
  9. <!---gets the id for ticketmaster an for all of the second part of form.--->
  10. <cfset pkID=#insertticketmaster.ID#>
  11.  
  12. <!---inserts/updates record into contacts table. if new inserts if not new will update old record.--->
  13. <cfquery name="insertcontacts" datasource="CustomerSupport">
  14. exec usp_CS_UpdateInsertcontacts  '#Form.clientID#','#Form.compname#','#Form.fname#', '#Form.lname#','#Form.address#','#Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','#Form.custnotes#'
  15. </cfquery>
where is what happens when i update the form
Expand|Select|Wrap|Line Numbers
  1. <!---Updates TicketMaster Table--->
  2. <cfquery name="Update" datasource="CustomerSupport">
  3. exec usp_CS_UpdateticketMaster '#Form.ID#','#Form.title#','#Form.priority#','#Form.status#','#Form.last_edited_by#','
  4.    #Form.clientID#','#Form.compname#','#Form.fname#','#Form.lname#','#Form.add1#','
  5.     #Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','
  6.     #Form.notes#','#Form.cost_center#','#Form.htpp#'
  7. </cfquery>
  8.  
  9. <!---Updates/Inserts Contacts table (should only update in this case unless they create a new customer number right here which they shouldn't)--->
  10. <cfquery name="insertcontacts" datasource="CustomerSupport">
  11. exec usp_CS_UpdateInsertcontacts  '#Form.clientID#','#Form.compname#','#Form.fname#', '#Form.lname#','#Form.add1#','#Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','#Form.notes#'
  12. </cfquery>

here is what happens when i submit the entire form for the 2nd an final time
Expand|Select|Wrap|Line Numbers
  1. <!---Inserts Data for General Information and Contact Information.--->
  2. <cfquery name="Update" datasource="CustomerSupport">
  3. exec usp_CS_UpdateticketMaster '#Form.ID#','#Form.title#','#Form.priority#','#Form.status#','#Form.last_edited_by#','
  4.    #Form.clientID#','#Form.compname#','#Form.fname#','#Form.lname#','#Form.address#','
  5.     #Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','
  6.     #Form.custnotes#','#Form.cost_center#','#Form.htpp#'
  7. </cfquery>
  8.  
  9. <!---Updates/Inserts Contacts table (should only update in this case unless they create a new customer number right here which they shouldn't)--->
  10. <cfquery name="insertcontacts" datasource="CustomerSupport">
  11. exec usp_CS_UpdateInsertcontacts  '#Form.clientID#','#Form.compname#','#Form.fname#', '#Form.lname#','#Form.address#','#Form.city#','#Form.state#','#Form.zip#','#Form.email#','#Form.priphone#','#Form.secphone#','#Form.custnotes#'
  12. </cfquery>
thats the only thing the 3 of them all have in common, the only thing different is that for the update it has a javascript script, but i don't think that could be it.

Any ideas?

Thank you for the help,
Rach
Sep 18 '08 #60
acoder
16,027 Recognized Expert Moderator MVP
Could you repost this in Coldfusion seeing as it's a Coldfusion question now.

Something to muse over while you do though: I do notice that you have spaces/line breaks for the afore-mentioned three fields within the quotes.
Sep 18 '08 #61
bonneylake
769 Contributor
Could you repost this in Coldfusion seeing as it's a Coldfusion question now.

Something to muse over while you do though: I do notice that you have spaces/line breaks for the afore-mentioned three fields within the quotes.
hey acoder, i reposted it here...hope thats ok.

http://bytes.com/forum/showthread.ph...75#post3356975
Sep 18 '08 #62

Sign in to post your reply or Sign up for a free account.

Similar topics

0
3463
by: Chris Sharman | last post by:
I'd like to design my pages to work cooperatively with browser autofill features. I've loked around, but can't find any good documentation on supported/unsupported field names...
1
18512
by: shortbackandsides.no | last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar autofill to act consistently, for example ======================= <html><head> <title>autofill test</title> </head><body>...
0
4246
by: David Portabella | last post by:
Hello, I am a doing a survey about Autofill Web Forms softwares. Usually, they all collect information of the user once during the set-up phase (user knowledge base). Then, when the user...
0
2288
by: Ray Holtz | last post by:
Is it possible to autofill a field based on what is entered into another field in a form? My form has an employee field, and department field. In an Items Table, I have fields FldEmployee, and...
4
15828
by: HTS | last post by:
I have written a membership database application (PHP + mySQL) and need to prevent autofill from filling in fields in a member record edit form. I know I can turn off autoFill in my browsers, I...
8
2355
by: tess | last post by:
I have: table 1 - tblLeadInfo which includes a salesman ID field table 2 - tbllkpSalesman with all zips in the state and a Salesman assigned to that area. I have a form based on table #1 When...
14
3457
by: 794613 | last post by:
Hello, I'm very new to access (about a week I've been working on this database) and am trying to make a database to track jobs for a company I work for. I've got the layout side of access laid out...
1
2099
by: Dean0621 | last post by:
Good morning folks, as with most people on here with their first time question, I have been working on this issue for nearly two weeks, doing some searching on this forum and the internet to assist...
1
3141
by: Nik Coughlin | last post by:
I'm doing some ajax validation on form fields, using the form change event. If I click Autofill in the Google Toolbar, fields are filled out but the change event is never fired, so the validation...
0
6912
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6744
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6981
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.