Skip to Content
author's profile photo
Former Member

Javascript in BSP

hi ,

iam using javascript for the functionality mentioned below:

i have 2 htm (main.htm and names.htm) in my BSP application. In the main.htm i have a button on clicking that i open names.htm as a popup and select certain values from the tableview in names.htm. On selecting a row and clicking on select button in names.htm, some fields in main.htm populate and names.htm gets closed.

my code is like this in names.htm: (javascript)

parent.opener.document.all("in_name").value = <%= rowselected %>;

parent.opener.document.all("addr_pop").value = <%= addr %>;

window.close();

rowselected and addr are assigned values in OnInputProcessing() method of names.htm

the first statement is working fine but the other statment doesnt work and nothing is happening as expected. Any one who used javascript have ideas lemme know.

thanks,

Shailaja

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Best Answer
    author's profile photo
    Former Member
    Oct 06, 2005 at 01:48 AM

    Hello,

    In the names.htm page just use the following javascript.

    <script language = "javascript">

    function fillid()

    {

    window.opener.document.frmintialpage.txtfnmgr.value = document.frmsecondpage.Selection.value;

    }

    </script>

    Hope this helps .

    Regards ,

    J

    Do Award Points if this's helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 06, 2005 at 05:23 AM

    Hi,

    You can try out something like this,

    In main.htm onClientclick of the button use this Java Script:

    window.open('names.htm','Select Names','width=400,height=500,scrollbars=yes')

    Now in the names.htm page, set a invisible input field and after selecting a name from the tableView and clicking the button set this value to the invisible field. Using Java Script you can pass the value in the invisible field to the main.htm page using this code:

    s=window.opener;	
    txt=s.document.getElementById("main_field");
    if ( document.form1.inv_field.value )
    txt.value = document.form1.inv_field.value;
    

    Here main_field is a input field in the main.htm into which the value is populated from the names.htm page.

    Hope this helps,

    Regards,

    Ravikiran.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 05, 2005 at 07:00 PM

    Hi,

    without your view code it is hard to say why your js code does not work. From my understanding this statement works:

    parent.opener.document.all("in_name").value = <%= rowselected %>;

    and this one does not:

    parent.opener.document.all("addr_pop").value = <%= addr %>;

    Is this correct? Since you have no idea what is going on I strongly recommend that you "pimp" your javascript development tools 😉

    For example mozilla firefox has a nice javascript console which records all js error messages and they often reveal what is going wrong.

    regards,

    Thomas

    Message was edited by: Thomas Ritter

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 06, 2005 at 03:45 AM

    You say that the first stt. is working (parent.opener.document.all("in_name").value = <%= rowselected %>;) but the other one not.

    in such a case you should be seeing a yellow error/warning in the IE status bar - double click to see what the error is

    we need more input to help u better.

    Regards

    Raja

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Oct 06, 2005 at 07:03 AM

    Hai Shailaja,

    Once you have selected a row,

    raise a server event and oninputprocessing assign the values to your variables

    rowselected,
    addr_pop

    then after u return.

    Add a button in your page say "OK".

    Then for the ok button add the following code.

    I think this works your problem

    <script language=JavaScript>
    function CloseForm()
    { 
       window.opener.document.all('in_name').value = <%= rowselected %>;
       window.opener.document.all('addr_pop').value = <%= addr %>;
       window.close(); 
    }
    </script>

    Regards

    Venkatesh

    Message was edited by: venkateshwarlu yelagandula

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi guys,

      thanks alot for ur reponse. I appreciate that. Iam sorry that i was not clear for some of u. But i tried a solution which is similar to P079223 and Ravikiran. it is working fine. I used the invisible fields in names.htm which are used to populate the corresponding fields in main.htm

      regards,

      Shailaja