on 06-06-2011 8:16 AM
Hi all,
I need to format an input field. When the user enters a value like 123456789, I need to default it to looks like 123-45-6789. After that I need to save the 123-45-6789 back as 123456789. Anyone have any ideas? Thanks.
Hi,
Always you want to do in that format?
write code in on enter of that input field. Get value entered in that input field, split that in 3 parts and do cancatnation with ' -'. Again while saving just
use previous data, what you enter in input field. you get using get_attribute.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try like this...
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
* get single attribute
lo_el_node->get_attribute(
EXPORTING
name = `VALUE1`
IMPORTING
value = lv_value1 ).
data : val1 type char20,
val2 type char20,
val3 TYPE char20.
move lv_value1+0(3) to val1.
MOVE lv_value1+3(2) to val2.
MOVE lv_value1+5(4) to val3.
CONCATENATE val1 '-' val2 '-' val3 into lv_value1.
* get single attribute
lo_el_node->set_attribute(
EXPORTING
name = `VALUE1`
value = lv_value1 ).
Cheers,
Kris.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.