JSP page invoke applet to realize the capitalization conversion of RMB (i)

Source: Internet
Author: User
Tags include lowercase variable
js| Case | rmb | page | conversion


Implementation method One

Applet Implementation page is rmb.jsp, this page is through the applet to achieve the RMB lowercase conversion to uppercase. This page has three variables that need to be initialized when classes is loaded:

<applet type= "applet" id= "myapplet" codebase = "" Name= "Testapplet"

Align= "Middle" code= "Lqh.rmb.Applicate.Rmb.class"

Width= "560" height= ">"

<param name= "Rgb_back" value= "241|247|251" >

<param name= "Rgb_fore" value= "255|0|0"/>

<param name= "Wigth" value= "560"/>

</applet>

Variable rgb_back is to initialize the background color, modify the secondary variable can make the background color of the applet and its own page style; variable rgb_fore is the color of the initialization font; Wigth to the width of the applet, this variable is guaranteed to display the conversion information in the middle.

This method cannot pass a value to the page trans.jsp and can only be displayed and cannot be copy.

The page code is as follows:

<%@ page contenttype= "text/html;charset=gb2312"%>

<script language=javascript>

function trans () {

Take the value of a variable

var aaa=document.rmb. Rmb_test.value;

Assign a variable to the applet value

Document.myApplet.setRMB (AAA);

Document.myApplet.repaint ();

return true;

}

</SCRIPT>

<body>

<form name= "RMB" >

Enter Amount: <input type= "text" name= "Rmb_test" onkeyup= "Trans ()" ><br>

<%@ include file= ". /rmb.jsp "%>

</form>

</body>

Implementation Method Two

Applet Implementation page is rmb.jsp, this page is through the applet to achieve the RMB lowercase conversion to uppercase. This page does not require a variable initialization, the image that the applet paints is not displayed on the page, and the converted value can be passed to the page variable:

<applet type= "applet" id= "myapplet" codebase = "" Name= "Testapplet"

Align= "Middle" code= "Lqh.rmb.Applicate.Rmb.class"

Width= "0" height= "0" >

</applet>

The page trans.jsp code is as follows:

<%@ page contenttype= "text/html;charset=gb2312"%>

<%@ include file= ". /rmb.jsp "%>

<script language=javascript>

function trans () {

var aaa=document.rmb. Rmb_test.value;

Get the converted Value

var RMB = Document.myApplet.getRMB (AAA);

DOCUMENT.RMB. Rmb_result.value = RMB;

return true;

}

</SCRIPT>

<body>

<form name= "RMB" >

Enter Amount: <input type= "text" name= "Rmb_test" onkeyup= "Trans ()" ><br>

Convert result: <input type= "text" name= "Rmb_result" ><br>

</form>

</body>




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.