on 07-27-2014 8:21 PM
Hello Experts,
I have some fields on the view corresponding to a value node. One of the fields is Phone number. When the user enters the phone number and moves to next field, I want to trigger a JavaScript function that formats the phone number.
I tired like this:
<script for="//CONTEXTNODE/ATTRIBUTE" event=onblur type="text/javascript" >
function()
{
-- code;
}
</script>
But, it's not getting triggered. Can someone please help me with this?
Thank you.
-Ezhno.
Any solution?!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maren,
Below code will work for your field with java script.
<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%
data: lv_Attr_name type string.
lv_attr_name = CONTEXT NODE NAME->IF_BSP_MODEL_BINDING~GET_ATTRIBUTE_NAME( attribute_path = 'ATTRIBUTE NAME').
%>
<script for="<%=lv_attr_name%>" event=onblur type="text/javascript" >
alert('Java Script Triggered');
</script>
<chtmlb:config mode = "RUNTIME"
xml = "<%= controller->configuration_descr->get_config_data( ) %>" />
Regards,
Naresh
Hello,
Do the standard formatting for phone number is not sufficient for your needs (based on country of address if I remember well) ?
If not, using javascript to reformat user entries does not seem the best way to go.
I'd rather try one of the following methods of the view you are using : DO_VALIDATE_INPUT or DO_FINISH_INPUT.
Best regards,
Sylvain AGUETTAZ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.