Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/473.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何基于另一个输入文本字段的特定值更改一个输入文本字段的值_Javascript_Html_Jquery_Jsp - Fatal编程技术网

Javascript 如何基于另一个输入文本字段的特定值更改一个输入文本字段的值

Javascript 如何基于另一个输入文本字段的特定值更改一个输入文本字段的值,javascript,html,jquery,jsp,Javascript,Html,Jquery,Jsp,我的HTML代码 订单号 订单金额 笔记 批准人 编辑 我的数据库: Field Type Collation Null Key Default Extra Privileges Comment --------------- ------------- --------------- ------ ------ ------- ------ ------

我的HTML代码


订单号
订单金额
笔记
批准人
编辑
我的数据库:

Field            Type           Collation        Null    Key     Default  Extra   Privileges                       Comment  
---------------  -------------  ---------------  ------  ------  -------  ------  -------------------------------  ---------
Order_ID         int            (NULL)           NO      PRI     (NULL)           select,insert,update,references           
Customer_Name    varchar(100)   utf8_general_ci  YES             (NULL)           select,insert,update,references           
Customer_ID      int            (NULL)           YES             (NULL)           select,insert,update,references           
Order_Amount     int            (NULL)           YES             (NULL)           select,insert,update,references           
Approval_Status  varchar(100)   utf8_general_ci  YES             (NULL)           select,insert,update,references           
Approved_By      varchar(100)   utf8_general_ci  YES             (NULL)           select,insert,update,references           
Notes            varchar(1000)  utf8_general_ci  YES             (NULL)           select,insert,update,references           
Order_Date       datetime       (NULL)           YES             (NULL)           select,insert,update,references           

我的问题是:如果我更改少于10000的订单金额,它将自动填充“David Lee”名称的Approved By字段。如何实现此功能?

使用onchange调用javascript函数进行检查

(如果您输入20000作为订单金额,则不会有任何更改,但如果您将其更改为1234,即小于10000,则系统将使用David Lee作为批准人)

函数autopopulate(){
if(document.getElementById(“txtAMT”).value*1<10000)
{document.getElementById(“txtApp”).value=“David Lee”;
}
}

订单号

订单金额
笔记
批准人 编辑
使用onchange调用javascript函数检查

(如果您输入20000作为订单金额,则不会有任何更改,但如果您将其更改为1234,即小于10000,则系统将使用David Lee作为批准人)

函数autopopulate(){
if(document.getElementById(“txtAMT”).value*1<10000)
{document.getElementById(“txtApp”).value=“David Lee”;
}
}

订单号

订单金额
笔记
批准人 编辑
您能否与我们分享您迄今为止尝试的内容?需要在后端代码(即:db)中进行更改?您能否与我们分享您迄今为止尝试的内容?需要在后端代码(即:db)中进行更改?