nine72 Posted January 29, 2007 Share Posted January 29, 2007 And if so how....OK, got some good instruction from nice people in the PHP secetion now looking for a bit of Ajax to go with.What I need to do is this...User enters a 4 digit code into the text field and to the right I need to have it print the definition of what that nubmer is. | Text Box | print definition of text input.exp. MCC Code: | 5942 | Book StoresThis needs to happen instantly or when they loose focus on that field. My forms are in sets of AJAX tabs.The codes are Merchant Class Codes for the Credit Card Industry they define risk, discounts, charge fees, reserve % etc. The code is what gets passed to my xml generator. The def is for the data monkeys that enter this stuff so they have an "at a glance" notice that they have the right MCC.There are no catagories for these codes, they are a long list of code numbers and def provided by VISA/MasterCard (they use the same codes to set rates). and since a business that sells widgets might be MCC 1000 and a business that sales boxes might be 8000 but a shop that sales widges and boxes might be a 4550. and then again depending on the person that sold the merchant the processing service might say that they are a 0785 for general sundries. its nutty.This is the php help that I received and it si good ( i was over thinkning what I needed to do...)<?php// Get the code passed from the form field$mmc = $_GET['mmc'];// Path to your code file$filepath = 'mmc_codes.txt';// Create an array of the file contents$codes = file($filepath);// Loop through the resultsforeach ($codes as $code){ list($c, $d) = explode(' ', $code); // Split the line on a space ($c is code, $d is description) if ($code == $mmc){ echo $d; }}?>(THANKS TO HUGGYBEAR FOR THIS PART!!)so now i would need the ajax to make it print "instantly" in on the form...any and all suguestions and help welcome.thanksnine72 Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted January 29, 2007 Share Posted January 29, 2007 http://www.w3schools.com/ajax/default.asp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.