views:

30

answers:

3

i need some code for the next step..this my first step:

<script>
$("#mod").change(function() {
       var barcode;
       barCode=$("#mod").val();
           var data=barCode.split(" ");
           $("#mod").val(data[0]);
           $("#seri").val(data[1]);
       var str=data[0];
       var matches=str.matches(/EE|[EJU]).*(D)/i);
      });
</script>

after matches..i want the result can connect to data base then show data from table inside <div id="value">...how to do that?

+2  A: 

you can start here. $.ajax();

You should have some server side scripting knowledge also.

Reigel
look at my answer..
klox
+1  A: 

You will need to do it using an ajax call (matches will be a parameter for the call). The php script called through ajax will have to fetch the data and give it back to the calling page. There you will need to parse the ajax response and display what you want.

A helpfull tutorial can be found here.

Thariama
look at my answer..
klox
A: 
<script>
$("#mod").change(function() {
       var barcode;
       barCode=$("#mod").val();
           var data=barCode.split(" ");
           $("#mod").val(data[0]);
           $("#seri").val(data[1]);
       var str=data[0];
       var matches=str.matches(/EE|[EJU]).*(D)/i);

       $.ajax({
                    type:"post",
                    url:"process.php",
                    data:params,
                    cache :false,
                    async :false,
                    success : function() {
                                           alert("Data have been input");
                                           $("#value").html(matches);


                                            return this;
                                     },
                    error : function() {
                                            alert("Data failed to input.");
                                    }
            });
            return false;

      });
</script>

and i change my process.php become:

select itemdata as version from settingdata where version = "tunerrange";
klox
are you not using jQuery now?.. for `ajaxObj`?
Reigel
owh..i guest ajxObj is jQuery syntax..may be i must edit my answer..
klox
could i do like this?
klox