How to insert Javascript within Javascript ?

I have a simple problem.
I want to insert Javascript within Javascript ???
Seems weird !!!
Here's the scenario :
I have created a JSP in which I have a function that Submits the main form in the main window.
Here's the function :
function SubmitContent()
document.f1.method='post';
document.f1.action='http://localhost:8080/examples/sherbir/texteditor2/page2.jsp';
document.f1.submit();
and here's the form description :
<form name='f1'>
But before that, on clicking the submit button in the main window, I am opening a child window to perform a few operations as follows :
<input type="button" name="bttn_preview" value="Preview" onClick="javascript:SeePreview()">
Here's the SeePreview() function which opens the child window:
function SeePreview()
var mywin=window.open("","","menubar=no,toolbar=no,scrollbars=yes,width=800,height=450");
mywin.moveTo(0,50);
mywin.document.write('<input type=button value="Make more changes"
onClick=javascript:window.close()>');
mywin.document.write('<input type="submit" name="child_bttn_sub" value="Proceed" onClick=self.close(); self.opener.SubmitContent();>');
The child window in turn has a submit button as defined above.
On clicking this button, I want the child window to close and hence submit the parent form also.
It's not happening !!
I even tried changing the order of the two statements in the OnClick event of the submit button in the child window.
I also tried self.opener.document.forms[0].submit()
None works.
Where's the problem ??
How do I remedy the situation ?
Please Help.

Not satisfiedAnd you won't be till you ask the right people for an answer. This is Java, and JavaServer Pages (JSP), not Javascript. If you go to a Javascript forum you will have a better chance of finding people who know more Javascript. Makes sense, doesn't it?

Similar Messages

  • Database connection(select ,insert query) within javascript function

    Hi ,
    How to write the database connection(insert,delete or select query) within javascript function.Is it possible.Anyone can you help me
    than you

    Hi ,
    How to write the database connection(insert,delete
    ete or select query) within javascript function.Is it
    possible.No

  • JavaScript within JSP

    Hi all !!
    I'm stuck up.
    Is there any way by which i can actually embed JavaScript within a JSP file that contains no JSP code. Actually it is file with .jsp extention but from within it holds only java script inside <script> tags.
    The prerequisite is there should be no performance implications... as this would be just a plain js file anyways.
    I need this coz i want to pick-up messages for alert from Resource bundle. For this i'am using <bean-el:message ...> tag. but using this in a plane .js file is not possible.
    How should i go about it.
    or
    Is there any better way to do this.

    You could put how much ever js that you need inside a jsp file. Theres no restrictions and given that you have to pick up messages using a tag, there's no other way out too.
    Other than the compilation time (which can be overcome by precompiling jsps), there's not much of a difference in the load time for a static html or html streamed from a jsp process. Ofcourse if you use the 'src' tag to load you js, each 'src' results in a round trip. However that's true of even static html pages.
    cheers,
    ram.

  • Cfquery within javascript

    hi,
    I am trying to do the following:
    I wrote a cfquery within javascript function as below:
    <script language="javascript1.2" type="text/javascript">
    <cfquery name="query1 datasource="abc">
    </cfquery>
    <cfif query1.recordcount neq "0">
        <cfoutput query = "query1">
           <cfquery name="query2 datasource="abc">
      select * from table1 where name=#query1.name#
           </cfquery>
        </cfoutput>
         alert(<cfoutput>#query2.RecordCount#</cfoutput>);
    </cfif>
    </script>
    The alert value is 1 but the debugging section shows 0, and 0 is the correct value. is there something wrong that I am doing.
    If so can you please point out...

    The problem comes from how CF and JS work: Coldfusion is a "Server Side" language while Javascript is "Client Side". This means the server runs through all the CF code in your page and sends the finished product on to the user's browser which THEN starts handling the Javascript.
    I'm not sure of your intended outcome ... do you want a series of "alerts" as soon as the page loads? If you are using the alert for debugging (just to see what is being returned, you can replace it with <p> tags and you will see the output on screen. Try this:
    <cfif query1.recordcount neq "0">
         <cfoutput query = "query1">
              <cfquery name="query2 datasource="abc">
              select * from table1 where name=#query1.name#
              </cfquery>
              <p>#query2.RecordCount#</p>
         </cfoutput>
    </cfif>
    2 more notes:
    you don't the inner "cfoutput" around you record output if you are going to use cfoutpu to loop over your query.
    the output line needs to be INSIDE the loop or you'll only output the last iteration.

  • NSDP from within javascript?

    Hi,
    I have noted that it has been suggested that utilisation of a Non Spatial Data Provider(NSDP) could actually speed up dynamic theme FOI rendering as the spatial column is not needed in the join towards the BaseMap.
    Can that be done from within javascript? Any examples? Could it speed up rendering even though basemap as well as foi themes are located in the same database?
    I'm experiencing somewhat poor performance using dynamic theme FOI rendering via jdbc_query.
    10.1.3.1
    Best regards Jesper

    Can you provide more details on the query and the performance issue you're experiencing.
    I'm not sure how using NSDP will speed things up. The spatial data still has to be queried and retrieved in order to render it.
    Jayant

  • Open PDF from database in a browser and run Javascript within PDF

    What we're trying to accomplish is to query a PDF in the database and open the PDF in the browse. Once opened if a user click on a link to open another PDF, it launchs a URL to Coldfusion, that queries the database and opens the PDF link. This all works but we also want to have the open PDF goto a section or bookmark within the PDF. We currently have JavaScripts within the PDF links that do that but only if the PDF is in the file system. We're using the app.openDoc to get a reference to the opened PDF. But when opening the PDF from the database we pass the control to Coldfusion using app.launchURL or app.getURL. These do not pass back a reference to the opened PDF and the JavaScripts fails.
    I'm looking for different methods or ideas.
    Is there another way to do this, I'm new to acrobat JavaScripting?
    Thanks, Rob

    I tried tapping and holding the attachment icon, it just shows "Open / Bookmark/ Copy"...
    Also i tried opening the attachement first and then tapping on it, it just shows "open in Safari"
    Is there any settings to be done to add the options of Opening in Adobe Reader/or any other Docu Sign app . the exhibition booth systems one would work i think
    Appreciate if someone could help

  • How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi
    Can anyone tell me.
    How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi Mithlesh,
    javascript runs on client side and you cannot assign the value to a Page attribute directly.
    As a workaround,you can use an Inputfield,hidden if required,and set the value using javascript.Then the form will have to be submit to be able to read the value in onInputProcessing and then can be assigned to any variable.
    In Layout
    <head>
    <script language="javascript">
    function pass()
       txt1 = document.getElementById("ip_mrf");
       txt.value = "hello" ;
    </script>
    </head>
    <htmlb:inputField  id="ip_mrf"
                               value="<%=mrf_number%>"
                               visible="FALSE"/>
    in onInputProcessing
    cha1 = request->get_form_field( 'ip_mrf' ).
    where cha1 is the page attribute
    hope this helps,
    Regards,
    Siddhartha
    Message was edited by: Siddhartha Jain

  • How can i assign a Javascript variable to JSP variable

    Hi guys
    how i can assign a javascript variable to jsp expression.,
    e.g.,
    <input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
    function submitform1(String s)
          var s1 = s
    document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
           document.form1.submit();
          return false;
    /*  i want to pass the values thru session whether it is possible */
    pls give sample code
    Reply
    Marimuthu

    You don't have the session.
    All you have is HTTP.
    The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
    Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

  • How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

    How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

    Hi hasvi,
    Need Template(.indt), textframes etc for the following script:
    var myFolderInd = Folder.selectDialog();
    var myFile = myFolderInd.getFiles("*indt");
    app.open(myFile)
    var myDoc = app.activeDocument;
    var myDocName = myDoc.name;
    var mySaveFile = app.activeDocument.save(myFolderInd.fsName + "/" + myDocName.split(".indt").join(".indd"));
    var myFolderDoc = Folder.selectDialog();
    var myFile1 = myFolderDoc.getFiles("*doc");
    mySaveFile.pages[0].textFrames[0].place(File(myFile1))
    //~ mySaveFile.place(File(myFile1))
    app.activeDocument.textPreferences.smartTextReflow = true;
    var myPDFFile = new File(mySaveFile.filePath + "/" + mySaveFile.name.split(".indd").join(".pdf"))
    myDoc.exportFile(ExportFormat.PDF_TYPE, File("~/Desktop/abc.pdf"));
    alert("Process Completed")
    Regards
    Siraj

  • How to find & replace in Javascript code?

    Hi all!
    I hope that this turns out to be an easy question! We recently updated several forms (about 50 of them) to alter a select set of field names per customer requirements. However, it turns out that one of these fields is a key field and is referenced in one or more places by JavaScript within the PDF.
    In Acrobat 6 I'd select the option to edit all scripts which would give me a big document with all of the Javascript within the PDF. I could then do a find/replace on the code and save it. Now, using Acrobat Pro 9, I cannot find anything like this. Please don't tell me that I have to search through all of the different form fields and PDF objects to find all of the script pieces tied to objects or events! I'm really, really hoping that there is an easier way to do this since right now I'm out of ideas and really don't want to have to sift through all of the objects in over 50 PDF documents.
    Thanks in advance for pointing me in the right direction!

    Talk about not being able to see the forest for all the trees! I can't believe that I missed that -- I spent quite a while looking all over before posting. *sigh*
    The exact menu sequence (for those interested) is Advanced -> Document Processing -> Edit All JavaScripts...  That is exactly what I needed. Thanks!!!

  • Help with replacing special characters and how/where to put the javascript...

    Hey there
    A while ago I added javascript to some parts of my PDF around the use of dates and phone numbers, I now have Acrobat 11, and I am at a loss of how to add a new javascript (i cant remember at all) the code I have is
    if (!event.willCommit) {
        event.change = event.change.replace(/\, "-");
    and it does not appear to be working, but if the code is right, then I am guessing I am putting it in the wrong place.
    Any help would be awesome.
    Cheers

    Probably like this:
    // Custom Keystroke script
    if (!event.willCommit) {
        event.change = event.change.replace(/\, "-");
        event.change = event.change.toUpperCase();
    If it doesn't work, post what the other script is and where it's placed.

  • How to know whether the javascript is disabled or not while loading the jsp

    Hi,
    My query is like how to know whether the javascript is disabled or not while loading the Application main JSP in Mozilla browser.
    I want some Java code or JavaScript code.

    To the point, just let JS fire a specific HTTP request inside the same session.
    This can be done in several ways. 1) Create a hidden <img> element and set the `src` attribute so that it will request a (fake) image from the server. The server just have to intercept on this specific request. 2) Fire an ajaxical request and let the server intercept on it. You can use a Filter for this which sets a token in the session scope to inform that the client has JS enabled.

  • How can we assign a JavaScript function on an TextInput action .

    Hello All ,
    I have a requirement that on ON_BLUR event of a MessageStyledText , I have to call a JavaScript function .
    This however should not refresh the page ( No submit action to the controller) .
    So how can we tie the JavaScript function to the TextInput at design time .
    Please auggest the needfull.
    Thank you,
    Srikanth

    Hi Tapash ,
    Actually my requirement was not to submit the form to controller .
    I got the solution for that . I have registered a JavaScript function to the MessageText in PR as
    pageContext.putJavaScriptFunction("callMethod","function callMethod() { var first=document.getElementById('First').value; ");
    OAMessageTextInputBean GoalTextBean2=(OAMessageTextInputBean)webBean.findChildRecursive("Second");
    GoalTextBean2.setOnBlur("callMethod()");
    Regards ,
    Srikanth

  • How to embed Flash without Javascript?

    How to embed Flash without Javascript? Other way to ask this: if user desactivates Javascript, sill Flash content still be visible?
    Thanks for helping.

    Hi
    This article may be of interest (shows with and without javascript methods), - http://perishablepress.com/press/2007/04/17/embed-flash-or-die-trying/.
    PZ

  • How can i use C/Javascript/php/Java in flex?

    can i embed these language into my flex project?
    since i have to check harddisk space, free memory remain. Also, i need to check the pixel of photos before the photos becoming bitmapdata
    please help~

    saipanBETTY0509 wrote:
    Subject: How can i use C/Javascript/php/Java in flex?
    can i embed these language into my flex project?
    You can't.  Why do you want to do this?
    saipanBETTY0509 wrote:
    since i have to check harddisk space, free memory remain. Also, i need to check the pixel of photos before the photos becoming bitmapdata
    I think what this means is "I want to check to see how much hard disk space is available.  Also, I need to check the pixel dimensions of an image."
    Is that right?
    There is no way in the Flash Player (as far as I know) that you can determine the amount of free disk space.  However, in AIR you can use air.File.applicationStorageDirectory.spaceAvailable to determine the storage space available in the application storage directory.
    As far as determining the dimensions of an image, there are plenty of good resources out there on that.  Maybe this one will be helpful to you?
    http://www.yswfblog.com/blog/2008/12/22/flash-10-experiments-the-warholizer-loading-and-pr ocessing-local-images/
      -Josh

Maybe you are looking for

  • Can I use a 30" Apple Cinema display with a new 27" iMac?

    I have a brand new iMac(27-inch, Late 2013), OS X Mountain Lion (10.8), i7 3.5 GHz, 32MB RAM, 4GB NVIDIA.  I will soon be upgrading it to Mavericks, if that makes a difference.  My understanding is that the resolution on it is 2560 x 1440. I'm lookin

  • GUI_Download Formating Issue

    Hi All, I am using GUI_DOWNLOAD function module to downlaod data to excel sheet and below is my code CONCATENATE P_file '\' 'Sheet_' TX_pernr '_' sy-datum '_' sy-uzeit '.XLS' into lv_File .      CALL FUNCTION 'GUI_DOWNLOAD'      EXPORTING       FILEN

  • Can't open pdf files posted in Facebook

    Instead of getting a dialogue box with the option to save the file I get redirected to a blank page. https://attachment.fbsbx.com/file_download.php?id=392022847530027&uid=1283073931&ext=13461 22360&hash=ASv7l5CiUPpVW0JI I have updated Adobe reader an

  • Converting Relational Tables to Object Views

    We have extra information stored for each field in a table. We call these Vertical Tables: rowid primary key - ties to normal tab column_name "" - ties to column in "" text_value the value if text reliability rating for level of accuracy... date of e

  • Trex problem

    Hi experts, I try to create an index but when I save I get an error that the index already exist. Index could not be created; creating index failed: An index already exists with the same name (errorcode 2003). In the index administration screen, the