Oracle Application Express javascript problem

Discussion in 'JavaScript' started by brett1, Sep 12, 2010.

  1. #1
    have a html region with the following code:

    <html>
    <head>
    <title>Report</title>
    </head>
    <SCRIPT language="JavaScript1.2">

    function items()
    {
    $s=('BINDTEST1');
    }

    function popon(url)
    {
    window.open (url, "EasyReportWriter",
    "location=1,status=1,scrollbars=1,width=1000,height=700, resizable");
    }
    </SCRIPT>

    I have a text box item "BINDTEST" that has html element set to:
    onchange="items();"


    I have a button with a url redirect of:

    javascript:popon('http://test/' + items());

    When I click on the button, popup window opens with test url but bindtest1 variable is not appended. What am I missing?
    Thanks,
    Brett

    Edited by: 794218 on Sep 12, 2010 8:20 AM
     
    brett1, Sep 12, 2010 IP
  2. HungryMinds

    HungryMinds Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #2
    Hi!

    Try This Method:

    
    <script>
    function items(action)
    {
    	s='BINDTEST1';
    	
    	if (action=='popon')
    	{
    		window.open("http://test/"+s, "EasyReportWriter", "location=1,status=1,scrollbars=1,width=1000,height=700, resizable");
    	}
    }
    
    function popon(url)
    {
    	window.open(url, "EasyReportWriter", "location=1,status=1,scrollbars=1,width=1000,height=700, resizable");
    }
    </script>
    
    PHP:
    Use This Function For Just Set Variable
    onchange="items();"

    Use This Function For New Popup Window With Set Variable
    onclick="items('popon');"
     
    HungryMinds, Sep 12, 2010 IP