How to do Plus Operation?
Dear all,
If you run this code, it will multiply the values of
txtValue1 and txtValue2. My question is .. how to do addition? If I
replace * operator with + operator, the two values will be added as
one string, not as a numeric. How to solve this problem?
<cfform format="flash" width="300" height="500">
<cfinput type="text" name="txtValue1" label="Value 1"
onchange="txtResult.text = txtValue1.text * txtValue2.text">
<cfinput type="text" name="txtValue2" label="Value 2"
onchange="txtResult.text = txtValue1.text * txtValue2.text">
<cfinput type="text" name="txtResult" label="Result">
</cfform>
Thanks in advance
Keiko
> If you run this code, it will multiply the values of
txtValue1 and txtValue2.
Yes. The code forces a cast to numbers, because the *
operator only applies to numbers.
> If I replace * operator with + operator, the two values
will be added as one string,
> not as a numeric.
The + operator applies to strings as well. By default the
value of formfield input is a string. Hence the string
concatenation. Use
txtResult.text = parseFloat(txtValue1.text) +
parseFloat(txtValue2.text)
for any numeric input, in general, or
txtResult.text = parseInt(txtValue1.text) +
parseInt(txtValue2.text)
if the input will only be integers.
Incidentally, wouldn't it be better to do something like this
instead?
<cfinput type="text" name="txtValue1" label="Value 1" >
<cfinput type="text" name="txtValue2" label="Value 2"
>
<cfinput type="text" name="txtResult" label="Result"
onfocus="txtResult.text = parseFloat(txtValue1.text) +
parseFloat(txtValue2.text)">
Similar Messages
-
How to store logical operator in an array in java
how to store logical operator in an array in java.
Array should not be String type if i pass an element of that array it should be considered as logical operatormy exact requirment is like this, i need some logic
to convert string like this "2 Equals 3 AND 4 greater
than 7" to condition like this
2 == 3 && 4 >7 which i can pass to if
condition.So you want to create an expression parser?
No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations. -
How to create business operation for starting workflows
How to create business operation for starting workflows from worklist?
When I call methods that implements business operation from java class everything
works fine(wlpi-ejb.jar is required), but when I call business operation from
Studio I can't use classes from wlpi-ejb.jar.Business operation is called by WLIS. So, I include wlpi-ejb.jar into WLIS classpath.
Studio uses deployed EJB from wlpi-*.jar, I don't know why Studio doesn't see
methods from deployed EJBs when WLIS classpath contains wlpi-ejb.jar.
"Andrew Pitonyak" <[email protected]> wrote:
>
When studio starts, what is your classpath? If you use the included batch
file to start it, then your class path may not include this :-)
Andrew
"Raul" <[email protected]> wrote in message
news:[email protected]..
How to create business operation for starting workflows from worklist?
When I call methods that implements business operation from java classeverything
works fine(wlpi-ejb.jar is required), but when I call business operationfrom
Studio I can't use classes from wlpi-ejb.jar. -
How to delete an operation from order using the bapi
Can somebody please tell me how to delete an operation from order using the bapi
BAPI_ALM_ORDER_MAINTAIN.
Following was the test data for the BAPI.
000000 OPERATION DELETE 0000040052810070
000000 SAVE 0000040052810070
Even I tried entering the operation table. The BAPI control ends fine, but when I check the order using IW32, the operation still exists.
So, can you please tell me where Iam going wrong.Hi Subash Mohanvel,
Check bapireturn parameter of the bapi BAPI_ALM_ORDER_MAINTAIN after execution of the code , and if there is no error message in the return table then call bapi_Transaction_commit.
Unless you call this database saving of the records/values will not get reflected in the system.
Hope that helps.
Regards
Kapadia
***Assigning points is the way to say thanks in SDN.*** -
How do I update operating system? To iOS 5 or 6
How do I update operating system? To iOS 5 or 6
Go to settings>general>software update>update! There you go.
-
How to use LIKE operator in plsql
Hi
I wanted to select certain rows using like operator in plsql(Input should be given by the user). I have given my experiment here .I couldn't get any result.
As per sql syntax while using LIKE operator we should give search criteria within single quote.where as in plsql if we give within single quote its takes as string so no output is comming.what is solution ? How to use like operator in plsql?
sql syntax
SQL>SELECT customer_name FROM customer_header
WHERE customer_name LIKE 'B%' ; customer_name
Bala murali
Babu
Basker
plsql syntax
PROCEDURE pro_custheader_like ( v_cname IN varchar2
,answer OUT type_refcur_customer) IS
BEGIN
OPEN answer FOR
SELECT customer_name FROM customer_header
WHERE customer_name LIKE ( ' v_cname ' );
END pro_custheader_like;
execution command
sql>variable answer refcursor;
sql>set serveroutput on
sql>exec package_name.pro_custheader_like( 'R',:answer);
plsql successfully completed
sql>print :answer
no row selected
by
balamuralikrishnan.splsql syntax
PROCEDURE pro_custheader_like ( v_cname IN
varchar2
,answer OUT
type_refcur_customer) IS
N
OPEN answer FOR
SELECT customer_name FROM customer_header
WHERE customer_name LIKE ( v_cname );
END pro_custheader_like;
Try it without any quotes. And, let us know your feedback.
Regards.
Satyaki De.
Message was edited by:
Satyaki_De -
How to use ternary operator in JSF using EL expression
how to use ternary operator in JSF using EL expression
I want to use ternary operator for h:datatable columnclasses attribute like as below
<h:datatable
columnClasses="#{booleanExpression ? style1,style2 : style3,style4}"
/>
But it's not working.Is there any other alternative to do this? -
Hi
I'm trying to implement SCD Type 2. I have done so using conventional methods.
I have read in some blogs that dimension operator can be used for SCD. Can any one provide me material on how to use Dimension Operator. I tried OWB User guide. But its not useful.
I have seen that we need to create levels. But i dont need levels.
Can somebody please tell me how to use it.
Regards
VibhutiHi Vibhuti,
using dimensions with OWB 10g R2 isn't that difficult. You just create a number of attributes like an ID, a business key and probably a description and then associate each of the attributes with a level. You need at least one level that all the attributes are associated to. Then you can use the slowly changing dimension wizard (SCD) to track changes. In the SCD settings you can determin for which attribute you want to trigger history and which attributes contain your effective date and your end date (if you want to use SCD type II). Obviously you would need two additional attributes in every level for that purpose.
Regards,
Jörg -
How to achieve logical operator on [Authorize(Roles = ] in MVC
For example, I need to make a controller accessible a user with two roles; role "Admin" and "Editor". How to achieve it.
[Authorize(Roles = "Admins")]
public class SampleController : BaseController
How to do logical operator, such as AND and OR (maybe || and &&)
Thanks!
Hello klouapple,
Please post your question to ASP.NET forum instead of here.
Best regards,
Barry
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to set multiple operating units in before report trigger
hi all
can any one help me out in getting clear in how to set multiple operating units in before report trigger in oracle report.
as we set single operating unit (mo_global.set_policy.context('S',81); as 81 is my operating unit).then who to set for multiple operating unit at run time.Sounds like eBusiness Suite, right? Better ask this in the appropriate forum.
-
How to update my operating system in ipad
how to update my operating system in ipad?
IOS 5 and above
Settings>General>Software Update
IOS 4
You need to connect to iTune (computer) to update software
http://support.apple.com/kb/HT4972 -
How many partitions and operating systems can you line up in BootCamp?
A quick question, hopefully with a quick answer.
How many partitions and operating systems can you line up in BootCamp?
Are we limited to just 2, or can we have more?
Say, for example, Mac, Win XP, Win Vista and Linux maybe?
Thanks in advance.VPC does not run on Intel Macs. If you wish to use virtualization on an Intel Mac see this:
Windows on Intel Macs
There are presently several alternatives for running Windows on Intel Macs.
1. Install the Apple Boot Camp software. Purchase Windows XP w/Service Pak 2 or Vista. Follow instructions in the Boot Camp documentation on installation of Boot Camp, creating Driver CD, and installing Windows. Boot Camp enables you to boot the computer into OS X or Windows.
2. Parallels Desktop for Mac and Windows XP, Vista Business, or Vista Ultimate. Parallels is software virtualization that enables running Windows concurrently with OS X.
3. VM Fusionand Windows XP, Vista Business, or Vista Ultimate. VM Fusion is software virtualization that enables running Windows concurrently with OS X.
4. CrossOver which enables running many Windows applications without having to install Windows. The Windows applications can run concurrently with OS X.
5. VirtualBox is a new Open Source freeware virtual machine such as VM Fusion and Parallels that was developed by Solaris. It is not yet fully developed for the Mac - some features are not yet implemented - but it does work otherwise.
6. Last is Q. Q is a freeware emulator that is compatible with Intel Macs. It is much slower than the virtualization software, Parallels and VM Fusion.
Note that Parallels and VM Fusion can also run other operating systems such as Linux, Unix, OS/2, Solaris, etc. There are performance differences between dual-boot systems and virtualization. The latter tend to be a little slower (not much) and do not provide the video performance of the dual-boot system.
See MacTech.com's Virtualization Benchmarking for comparisons of Boot Camp, Parallels, and VM Fusion.
Boot Camp is only available with Leopard. The Boot Camp Beta that was used with Tiger has expired and is no longer available for use. So contrary to the other poster's comment, Boot Camp isn't truly "free." You must purchase Leopard to get it.
You can upgrade XP to Vista without having to make any changes to the Boot Camp partition. Vista can either perform an upgrade install or erase the Windows volume before installing Vista. You don't need to do anything to change the partition via Boot Camp. However, if you need to enlarge the partition, then the only way that can be done is to first use Boot Camp to remove the partition. Then use Boot Camp to make a new, larger partition. All data from the Windows partition will be lost. -
I just tried to reset my iPad...then couldn't reset it. I don't know how to install the operating system on it again
Is this how you reset?
1. Hold the Sleep and Home button down (together)
2. For about 10 seconds
3. Until you see the Apple logo (very important)
4. Ignore the red slider -
I may have been hacked. How do I reinstall operating system of my imac 4
I may have been hacked. How do I reinstall operating system of my imac version 10.7.5
Install or Reinstall Lion/Mountain Lion from Scratch
Be sure you backup your files to an external drive or second internal drive because the following procedure will remove everything from the hard drive.
Boot to the Recovery HD:
Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
Erase the hard drive:
1. Select Disk Utility from the main menu and click on the Continue button.
2. After DU loads select your startup volume (usually Macintosh HD) from the
left side list. Click on the Erase tab in the DU main window.
3. Set the format type to Mac OS Extended (Journaled.) Optionally, click on
the Security button and set the Zero Data option to one-pass. Click on
the Erase button and wait until the process has completed.
4. Quit DU and return to the main menu.
Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Install button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible
because it is three times faster than wireless. -
When do I use unary plus operator?
When would I ever use the unary plus operator? It seems to me to be a pointless operation since +x never changes the value of x.
You're talking about shorthand assignment operators. I'm talking about unary operators like + and -. There is no syntax error in the following code, and I would like to know in what situations the unary + operator would ever be used.
class a {
public static void main (String[] args) {
int i=1;
i=+1;
i=-1;
}
Maybe you are looking for
-
Automatically assign conditional text to xml tag
Hello, is there a way to automatically assign a "conditional text" to a xml tag. Either on xml import or with a script? Thank you all for your help.
-
Xfce4 install wiped out ld.so.conf???
I reinstalled Arch on 3/7 to go back to JFS from ReiserFS (also, prior install was x86_64, current is i686). I use both KDE and Xfce4, but didn't reinstall Xfce4 until 3/12, at 16:09, according to pacman.log. I did a pacman -Syu yesterday (I *never*
-
Some MP3s won't play???
some mp3s will load up and show and play while the ipod is hooked up to the computer but once I disconnect and listen to my ipod separately I noticed that some mp3 arent there. how can I fix? thank in advance
-
BBM to individual works, but 'unreachab​le' in a Group??
Hi, When I use BBM directly to my daughter (one to one) it all works fine. When I add her to a Group on BBM she always shows as 'unreachable' and can not bbm the group. We have tried: - Deleting group, re-adding - Deleting all contacts, re-adding - C
-
Dear Experts, Just want to know whether we can send Mail Alerts when updating the Project status? If it is possible for both System Status as well as User Status? Appreciate your guidance, Dileepa.