on 06-28-2007 1:36 PM
Hi
Please tell me how to get value from java script to ABAP variable.Here I have a Date variable Which is the input.After the client validations I have to move this value to LV_DATE which is ABAP variable.Please see my code and help me.
<script type="text/javascript">
function checkInput()
{
var dateval = document.form1.date.value
alert(dateval);
var today = new Date();
var get_date = today.getDate();
if (get_date < 9)
{
get_date = "0"+get_date;
}
var get_month = today.getMonth()+1;
if (get_month < 9)
{
get_month = "0"+get_month;
}
var today_date = get_date"."get_month"."(today.getFullYear());
alert(today_date);
if (dateval == "" || dateval > today_date)
{
alert("please enter date less than or equal to today");
}
else
{
htmlbSL(this,2,'mybutton:Submit');
}
}
</script>
<htmlb:tray id = "t1"
title = "Sample Window"
design = "BORDERLESS"
isCollapsed = "false"
width = "75%" >
<htmlb:trayBody>
<htmlb:textView text = "Hello World!"
textColor = "RED"
design = "HEADER1"
align = "CENTER" />
<htmlb:inputField id = "date"
type = "DATE"
showHelp = "TRUE"
alignment = "CENTER"
/>
<htmlb:button id = "mybutton"
text = "Press Me"
onClientClick = "javascript:checkInput();" />
</htmlb:trayBody>
</htmlb:tray>
I am new to BSP Please tell me indetail.I also went through the previous posts but I didn't get it perfectly.
Thank You.
Regards
Giri.
Do the below changes:
<htmlb:inputField id = "date"
type = "DATE"
showHelp = "TRUE"
value = "<%= LV_DATE %>"
alignment = "CENTER"
/>
TO Get the value from FORM...<b>In OnInputprocessing:</b>
LV_DATE = request->get_form_field( 'date' ).
<i>*Reward each useful answer</i>
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I went through the forum and found that DO_HANDLE_DATA event is called when we are calling the page or leaving the page.Here I want to explain you indetail about my application.I have a date input field whenever the user enter the date value and clicks on the button I have to display all prime rates for that particular date on the same screen.It means I have to display input field and output fields on the same screen.So I am not leaving the page.Please help me how in this case how to get the date value(in HTMLB or Javacsript) which is entered by user into the ABAP.
Thank You.
Regards
Giri
Hi!
First you need a form tag around your coding. It could look like this:
<htmlb:form id = "form1">
</htmlb:form>
And you need to declare your variable "date" at page attributes of your BSP. Don't forget to set the "auto flag".
Hope this helps
Regards
Mark-André
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.