HP tables
ID Name (item name) Kucun (stock) Danwei (unit) Danjia (outbound unit price) Tiaoma (barcode)
1 ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ........... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ..... ....... ..... 1234
Reply to discussion (solution)
And after each sweep of the item, the text is automatically tiaoma (to sweep the other item), and the cursor is displayed in the text Tiaoma
You need to use Ajax.
You need to use Ajax.
Please help to write
Someone help write it down?
Did you scan the barcode and jump to this page?
SELECT * FROM HP where tiaoma= ' 1234 ';
When you find the record, Echo comes out.
Did you scan the barcode and jump to this page?
SELECT * FROM HP where tiaoma= ' 1234 ';
When you find the record, Echo comes out.
I mean, each sweep one is shown below one, sweep a few to show a few
After sweep, submit to PHP, and then return the content, with JS plus a table on it.
Ajax operations.
The question is how you sweep the program.
After sweep, submit to PHP, and then return the content, with JS plus a table on it.
Ajax operations.
The question is how you sweep the program.
No Ajax, can you help to write it?
Sweep of the program is a form submission, in the text box after the bar code, the text box will appear a series of numbers, and then submit
Search on the Internet for a class to be prepared:
3. How toEnter the bar code and add a line directly, without the need to click??
Http://www.cnblogs.com/Johnny_Z/archive/2012/06/17/2552597.html
Why is the code below not working? What's wrong?
oa_api.php as follows:
if ($action = = ' Get_oa_vip ')
{
if (! ( Isset ($_session[' userid ') && $_session[' userid '] > 0))
{
Ajax_error (' Please login first! ');
Exit
}
Take school_id if there is no school_id then exit
$sql = "Select SchoolID from". $fdyu->table (' users '). "Where user_id=". $_session[' UserID '];
$school _id = $db->getone ($sql);
if ($school _id < 1)
{
Ajax_error (' You don't belong to any school, you can't use this feature! ');
Exit
}
$VIP = $_get[' VIP '];
$ajax = Array ();
$sql = "Select Xy_id,jifen from". $fdyu->table (' Oa_vip '). "Where vip= '". $vip. "' and school_id=." $school _id. "";
$res = $db->query ($sql);
if ($res)
{
$ajax [' status '] [' code '] = ' 1 '; Success
$ajax [' record '] [' jifen '] = $row [' Jifen '];
$ajax [' record '] [' xy_id '] = $row [' xy_id '];
}
echo Json_encode ($ajax);
Exit
}
After a layer of troubleshooting, PHP returned the value is also obtained, now is not know how to put the obtained value into
This, that is, the following paragraph has a problem, how should I write?
var NewRow = $ (""). Append ($ (""). Append (xy_id))
. Append ($ (""). Append (Jifen))
. Append ($ (""). Append (BTN));
return newRow;
$,post (url,{args:args},function (data) {
alert (data);
})
Getting result sets asynchronously
$.ajax ({
Type: "POST",//Transmit by post
URL: ' f.php ',//destination address.
DataType: "JSON",//Data format: JSON
Data: "dealtype=" + Dealtype + "&uid=" + uid + "&code=" + code,
Data: "&a=" +mobile,
Success:function (JSON) {
if (json.msgid==1) {//successful processing
alert (json.html);
}
else if (json.msgid==2) {//Failed handling
alert (json.html);
}
else{
alert (json.html);
}
}
});
After success, with jquery events, join
var NewRow = $ (""). Append ($ (""). Append (xy_id))
. Append ($ (""). Append (Jifen))
. Append ($ (""). Append (BTN));
return newRow;
Try the
Now my program has been able to get the returned value normally,
if (data.status.code== "1")
{
Success
var jifen = Data.record.jifen;
var xy_id = data.record.xy_id;//Here can get to the normal
....
Now my question is, how do I insert the obtained value into the table below
Who can tell me how to write?
Now my program has been able to get the returned value normally,
if (data.status.code== "1")
{
Success
var jifen = Data.record.jifen;
var xy_id = data.record.xy_id;//Here can get to the normal
....
Now my question is, how do I insert the obtained value into the table below
Just answer my question, and don't write a new way.
It's been one months, and it's not settled yet?
Online Dynamic Add table line JS code More, one months can not find the right for you?
Don't know what keyword to search, so always wait for the answer
Now is the last step, please help me to write, I now go online search certainly and I now write not the same, I have to study long time
Do you have any help writing?
Can you see?
Yes, thank you.
But there's another problem. You, is the same code can not be repeated add what should be done?
It's done.
Change the way:
function Getnewrow () {
$.get ("/oa/oa_api.php?act=get_oa_vip", {
vip:$ ("#name"). Val (),
Async:false,
Rand:Math.random ()
},function (data) {
if (data.status.code== "1")
{
Success
var jifen = Data.record.jifen;
var xy_id = data.record.xy_id;
if ($ ("#tr_" +xy_id). Length > 0)
{
Cleartext ();
return false;
}
var btn = '';
var trhtml;
trhtml = ";
Trhtml + = "+ xy_id +";
Trhtml + = "+ Jifen +";
Trhtml + = "+ btn +";
$ ("#table1"). Append (trhtml);
Cleartext ();
}
}, "JSON");
}