<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Javascript and BSPs in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055796#M90334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Hartman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have faced a similar problem,Here when u are naming &lt;/P&gt;&lt;P&gt;the ID or names of  input fields make sure that does not &lt;/P&gt;&lt;P&gt;contain "],[,,." special characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you specify the id of the input field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am including a sample program where I am updating a &lt;/P&gt;&lt;P&gt;hidden field with the value entered in the input prompt &lt;/P&gt;&lt;P&gt;with javascript .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Page with flowlogic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;%@page language="abap" %&amp;gt;
&amp;lt;%@extension name="htmlb" prefix="htmlb" %&amp;gt;
&amp;lt;htmlb:content design="design2003" &amp;gt;
  &amp;lt;htmlb:page title="Input prompt " &amp;gt;
  &amp;lt;script language="JavaScript" type="text/javascript"&amp;gt;
                 function save_input_prompt()
                 {
                  var varient_name = prompt("Save Varient as ?","");
                   if (varient_name == null )
                   return false;
                   else if (varient_name == "" || varient_name == " ")
                    {
                      alert("Enter a valid input");
             	        return false;
                    }
                   document.mainform.if_varient_name.value =varient_name;
                   alert( document.mainform.if_varient_name.value );
                  return true;

                 }
      &amp;lt;/script&amp;gt;
    &amp;lt;htmlb:form id="mainform" &amp;gt;

      &amp;lt;htmlb:inputField id    = "if_varient_name"
                        value = "abc"
                        visible = "false" /&amp;gt;
      &amp;lt;htmlb:button id            = "save_query_open"
                    text          = "Save as"
                    onClick       = "EVT_SAVE_QUERY"
                    onClientClick = "if(!save_input_prompt()) htmlbevent.cancelSubmit=true;"
                    tooltip       = "Save Query" /&amp;gt;
    &amp;lt;/htmlb:form&amp;gt;
  &amp;lt;/htmlb:page&amp;gt;
&amp;lt;/htmlb:content&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input processing .&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA lv_string TYPE string.
lv_string = request-&amp;gt;get_form_field( 'if_varient_name' ).

DATA: data TYPE REF TO cl_htmlb_inputfield.
data ?= cl_htmlb_manager=&amp;gt;get_data( request      = runtime-&amp;gt;server-&amp;gt;request
                                    name         = 'inputField'
                                    id           = 'if_varient_name' ).
IF data IS NOT INITIAL.
  lv_string = data-&amp;gt;value.
ENDIF .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put a break pointer in inputprocessing to check if you &lt;/P&gt;&lt;P&gt;can retrive the value properly. I have included two ways of retiving &lt;/P&gt;&lt;P&gt;value from the form fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally,&lt;/P&gt;&lt;P&gt;This is the wrong forum that u have posted this question.&lt;/P&gt;&lt;P&gt;There is a seperate forum for BSP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;venkatesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2005 06:10:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-11-17T06:10:47Z</dc:date>
    <item>
      <title>Javascript and BSPs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055792#M90330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a BSP application where I am displaying the contents of a table on a BSP page, and allowing the user to change the table items.  I also want to add some javascript to update some of the fields in the table, but I am having trouble with the indexes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample of my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;% loop at t_qtitems into w_qtitems. %&amp;gt;
&amp;lt;input type="text" name="t_qtitems[&amp;lt;%=sy-tabix%&amp;gt;].rqmult"
    size="2" maxlength="5" value="&amp;lt;%=w_qtitems-rqmult%&amp;gt;"&amp;gt;
&amp;lt;% endloop. %&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to add a button to use javascript to update the input text fields using javascript.  However, when I view the web page, I see this as the field name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" size="2" maxlength="5"
  name="t_qtitems[1 ].rqmult"&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to use javascript to update this input field, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;frmInput.t_qtitems[1 ].rqmult.value=100;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I receive a javascript error "frmInput.t_qtitem.1 is null or is not an object".  How do I change the indexed items from this table using javascript?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2005 15:34:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055792#M90330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-16T15:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript and BSPs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055793#M90331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Denise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Try with t_qtitems[1 ].rqmult.value=100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Kam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2005 15:49:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055793#M90331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-16T15:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript and BSPs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055794#M90332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That doesn't work.  This is javascript where I am doing this change, so I need to reference the html form where the field that I am trying to update resides.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2005 16:15:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055794#M90332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-16T16:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript and BSPs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055795#M90333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with &lt;/P&gt;&lt;P&gt;frmInput.elements["t_qtitems[1 ].rqmult"].value=100;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Amara.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2005 05:45:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055795#M90333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-17T05:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript and BSPs</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055796#M90334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Hartman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have faced a similar problem,Here when u are naming &lt;/P&gt;&lt;P&gt;the ID or names of  input fields make sure that does not &lt;/P&gt;&lt;P&gt;contain "],[,,." special characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you specify the id of the input field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am including a sample program where I am updating a &lt;/P&gt;&lt;P&gt;hidden field with the value entered in the input prompt &lt;/P&gt;&lt;P&gt;with javascript .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Page with flowlogic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;%@page language="abap" %&amp;gt;
&amp;lt;%@extension name="htmlb" prefix="htmlb" %&amp;gt;
&amp;lt;htmlb:content design="design2003" &amp;gt;
  &amp;lt;htmlb:page title="Input prompt " &amp;gt;
  &amp;lt;script language="JavaScript" type="text/javascript"&amp;gt;
                 function save_input_prompt()
                 {
                  var varient_name = prompt("Save Varient as ?","");
                   if (varient_name == null )
                   return false;
                   else if (varient_name == "" || varient_name == " ")
                    {
                      alert("Enter a valid input");
             	        return false;
                    }
                   document.mainform.if_varient_name.value =varient_name;
                   alert( document.mainform.if_varient_name.value );
                  return true;

                 }
      &amp;lt;/script&amp;gt;
    &amp;lt;htmlb:form id="mainform" &amp;gt;

      &amp;lt;htmlb:inputField id    = "if_varient_name"
                        value = "abc"
                        visible = "false" /&amp;gt;
      &amp;lt;htmlb:button id            = "save_query_open"
                    text          = "Save as"
                    onClick       = "EVT_SAVE_QUERY"
                    onClientClick = "if(!save_input_prompt()) htmlbevent.cancelSubmit=true;"
                    tooltip       = "Save Query" /&amp;gt;
    &amp;lt;/htmlb:form&amp;gt;
  &amp;lt;/htmlb:page&amp;gt;
&amp;lt;/htmlb:content&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input processing .&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA lv_string TYPE string.
lv_string = request-&amp;gt;get_form_field( 'if_varient_name' ).

DATA: data TYPE REF TO cl_htmlb_inputfield.
data ?= cl_htmlb_manager=&amp;gt;get_data( request      = runtime-&amp;gt;server-&amp;gt;request
                                    name         = 'inputField'
                                    id           = 'if_varient_name' ).
IF data IS NOT INITIAL.
  lv_string = data-&amp;gt;value.
ENDIF .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put a break pointer in inputprocessing to check if you &lt;/P&gt;&lt;P&gt;can retrive the value properly. I have included two ways of retiving &lt;/P&gt;&lt;P&gt;value from the form fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally,&lt;/P&gt;&lt;P&gt;This is the wrong forum that u have posted this question.&lt;/P&gt;&lt;P&gt;There is a seperate forum for BSP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;venkatesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2005 06:10:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/javascript-and-bsps/m-p/1055796#M90334</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-11-17T06:10:47Z</dc:date>
    </item>
  </channel>
</rss>

