on 12-28-2009 5:52 PM
Hi,
I have two very basic queries:
1) I created a simple non-mvc based bsp application wherein I marked few input fields mandatory by setting required property to true. On submitting the page it used to give me error incase I have left any required fields blank of its own, but after I created the entire application now the error has disappeared and it is allowing me to post the data from the page even if the mandatory fields are left blank. Kindly guide so as to what changes I could have done that the error has disappeared or how can I get it now.
2) When I am doing any server side validation based on the user input I want to show some values calculated at runtime as a javascript alert but unable to pass the value to javascript.
Please help.. any 1-2 liner code would help a lot..
Saurabh Tripathi
Post your code here for issue #1.
For issue#2:
<s-cript>
var = <%= abap_variable %>
</s-cript>
If you want to show the value in alert then use below code:
al-ert('<%= abap_variable %>');
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi raja,
regarding issue 1:
layout- <htmlb:inputField id = "firstname"
value = "<%= gs_transaction-firstname %>"
size = "40"
maxlength = "40"
required = "TRUE"
disabled = "<%= lv_disabled %>" />
oninputprocessing()-
lr_event = cl_htmlb_manager=>get_event( runtime->server->request ).
CASE lr_event->server_event.
WHEN 'onSubmit'.
navigation->use_auto_submit_form( ).
....logic...
endcase.
now pls help as where to write a code where firstname is checked as required field and also help me with the purpose of use_auto_submit_form() here, i thought it should automatically tell the required field errors
Set the REQUIRED attribute to "true" in htmlb:inputField, and doValidate = "true" , upon submission of the form, the mandatory input fields are automatically validated.
Also search this forum as you will find many thread on the same.
For issue#2:
Make sure you remove '-' in s-cript, a-lert. After Alert, Replace the . (dot) with ; .If issue persist, debug and check if gv_message has the value.
a-lert("<%=gv_message%>");
Raja
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.