on 10-14-2008 10:05 AM
Hi,
I want to know how to use find and replace tag of BSP.Actually my requirement is onchange of value in Input field i want to calculate somthing.Can any body help me.
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This looks pretty weird in coding ^^
I would solve this issue with javascript only:
function onLoad(){
document.getElementById('myInputField').on'keyup = function(){startTimer();};
}
var timer = null;
function startT imer(){
if(timer != null){
window. clear'Timeout(timer);
}
timer = window. set'Timeout("timerTick()", 3000);
}
function timerTick(){
// calculate whatever you want
}
When the user enters something in the myInputField a timer is startet. As soon as no key is hit for a minimum of 3 seconds, the calculation is done.
I had to add the ' to the javascript functions because I get an error from the forum without...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suman,
<bsp:findAndReplace find = "<input"
replace = "< i n p u t o n C h a n g e = c a l c v a l ( ) ; >
<htmlb:in p u t F i e l d i d = "ip"
va l u e = " < % = r e q u e s t - > g e t _ f orm_field( 'ip' ) %> "
alignment = "left" />
</bsp:findAndReplace>
you can write a fuction in JS for your calculations.
Regards,
Anubhav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anubav,
i am getting some text beside my input field in the output and more over event also not triggering.check my code
<bsp:findAndReplace find = "<input"
replace = "<i n p u t o n C h a n g e = g e t V a l ( ) ; > " >
<htmlb:i n p u t F i e l d i d = "ip1"
v a l u e = "<% = v a l u e 1 % > "
a l i g n m e n t = "left"
/>
</bsp:findAndReplace>
check this sample...
< % @ p a g e language="abap" % >
< % @ e x tension name="h t ml b" prefix="h t ml b" % >
< % @e xt ens io n nam e="bsp" pr efix="b sp" % >
< ht m l b:c ont ent d esig n="desi gn2 0 03 ">
< ht mlb :page title = " " >
< ht mlb:fo rm >
< % d ata: v al(10) .% >
< ht m lb:textView text = "Hello World!"
design = "EMPHASIZED" />
< bs p:findAndReplac e find="<input"
re p lac e="< input onc hange = ` al ert( 'ale rt' )`" >
< h t mlb:in pu tField id="i1" value="<%= val %> " / >
< / b sp:findAndRe place >
< h t ml b:b utto n text = "Press Me"
onC lick = "myClickH andler" / >
< /h tm lb:f or m >
< / h tm lb:p a g e >
< / h t ml b:c on ten t >
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.