on 12-10-2004 6:15 PM
Hi,
I have a inputfield say: t_comp_code where I want the user to enter the Company Code.Then I want to check the Company Code master table to see if the entry exists or not. This I want to do oBlur of the field and then output an error message in an alert box via Javascript.
How do I achieve reading an internal table & then calling the Javascript function if sy-subrc = 0?
And where do I select all values of the master table?
As I am new to BSP I am having problems visualizing this.
Please help.
Regards
Tejaswini
check out onClientClick you can activate Javascript there for a button element or so.
As for giving a variable to JavaScript you have to set the variable in your event handler then pass it to your page layout
<script>
alert(<%=myvalue%>);
</script>
If you set a page attribute called myvalue TYPE STRING and in OnCreate set
myvalue = 'hello'.
Do that on a test page and you will get a good idea how passing to JavaScript can work.
As for reading tables and so you can do that in the Event Handlers or in the page layout with ABAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OnBlur can be achieved like below.
<htmlb:form>
<%
tmp_string = `<input onBlur="javascript:checkCompanyCode(this);"`.
%>
<bsp:findAndReplace find = "<input"
replace = "<%= tmp_string %>" >
<htmlb:inputField id = "myInputField2"
value = "ABC"
alignment = "left" />
</bsp:findAndReplace>
</htmlb:form>
Regards
Raja
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.