表单中有4个INPUT(A,B,C,D),其中2个input值输入(A,B),1个input值(C)由一个输入的input值(B)大小而从数据库中读出,另外1个input(D)存储结果,怎么实现两个input值相加(A+C)后显示在另外一个input中(D)?PS:从数据库中读取的数怎么填充在input中(C),谢谢
回复讨论(解决方案)
去学习下Ajax的用法。
去学习下Ajax的用法。
明天要使用,请问怎么实现读取数据库中值填充至input中呢?
从数据库中读取的数怎么填充在input 可以用PHP。
两个input值相加可以用JS完成。
具体如何,你得贴出相关代码。
异步加载input填充读取数据库
用js或用ajax都可以实现
从数据库中读取的数怎么填充在input 可以用PHP。
两个input值相加可以用JS完成。
具体如何,你得贴出相关代码。
想实现输入日期后,依据日期从数据库中读取相应汇率并填充至汇率input中,请问如何实现,代码如下:
<html><head><!--日历控件--><script src="Calendar1.js"></script><script>function result_note(){ alert("无符合条件记录");}</script></head><body><img src="/static/imghwm/default1.png" data-src="image/2.jpg" class="lazy" / alt="怎么实现两个input值相加后显示在另外一个input中及数据库中数填充在input中?" ><input type="button" name="start_time" value="系统使用" onclick="location='exchange_index.php';"></input><input type="button" name="start_time" value="系统维护" onclick="location='exchange_add.php';"></input> <form id="input_form" method="get" action="exchange_index.php" onsubmit="return checkdata()"> <table width="600" border="0" cellpadding="0" cellspacing="0" align="center"> <br> <br>   币种        金额        日期       汇率      结果(人民币) <br> <select name="currency_name"> <option value="<?php echo $_REQUEST [currency_name]; ?>" selected="selected"> <?php if ($_REQUEST [currency_name] == "") echo "请选择"; elseif ($_REQUEST [currency_name] == "美元") echo "美元"; elseif ($_REQUEST [currency_name] == "日元") echo "日元"; elseif ($_REQUEST [currency_name] == "人民币") echo "人民币"; ?></option> //应用时需要修改 <option value="美元">美元</option> <option value="日元">日元</option> <option value="人民币">人民币</option> <option value="">请选择</option> </select> <input type="text" autocomplete="off" name="money_1" size="12" value="<?php echo $_REQUEST [money_1]; ?>"/> * <input autocomplete="off" onfocus="calendar()" name="exchange_date_1" type="text" size="10" value="<?php echo $_REQUEST [exchange_date_1]; ?>" /> <input type="text" autocomplete="off" name="currency_value_1" size="10" value="<?php $row[currency_name]?>"> = <input type="text" autocomplete="off" name="result_1" size="10" value="<?php $row[currency_name]?>"> <br> <!--<?php echo '$_REQUEST [money_1]='.$_REQUEST [money_1];?>--> </table> <p align="center"><input type="submit" onclick="javascript:return confirm_submit()" value="计算"> <input type="button" onclick="location='exchange_index.php';" value="重置"></form> <?php include("connect.php");//设置查询条件$strwhere="";$currency_name=$_REQUEST["currency_name"];$exchange_date_1=$_REQUEST["exchange_date_1"];$strwhere=$strwhere.' and exchange.currency_name = '.'"'. $currency_name .'"'.' and exchange.exchange_date = '.'"'. $exchange_date_1 .'"';$sql="SELECT * FROM exchange where 1=1 ".$strwhere;//echo '$sql='.$sql;//echo '$sql='.$sql;$result=mysql_query($sql) or die(mysql_error());//判断是否有符合条件记录if(!$num = @mysql_num_rows($result)){echo "<script type='text/javascript'>result_note();</script>";die("");}$row=@mysql_fetch_array($result)?> </body></html>
用js或用ajax都可以实现
请问具体如何实现
js 能获取动态数据的基本上行就是ajax
利用ajax已实现,谢谢各位

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment