Ot: using javascript within asp

Hi - I'm new to asp and badly in need of help.
On one page I'm using several recordsets from the same
database. The code for each is repeated wit only a couple of
variables being changed.
I'd like to save code by creating an array and letting the
array change the variables - However I can't seem to get it to work
- when I use document.write - the code just appears as text on the
browser page.
Can anyone point me in the right direction?
much obliged
Drew

Hi Drew,
Remember. IT may be a matter of where/when the code is
executing. The record
sets are happening server side. JS 'document.write' is
written to the page
(actually the server outsput stream) as it is deleviered to
the client. So,
your record set code never sees it.
If you are using bound data on the client side, we need more
information
about what you are doing to answer your question.
Alan C
alan (a t) cates-associates (d ot) net
http://www.cates-associates.net
"webewitch" <[email protected]> wrote in
message
news:e7ogjs$eq$[email protected]..
> Hi - I'm new to asp and badly in need of help.
>
> On one page I'm using several recordsets from the same
database. The code
> for
> each is repeated wit only a couple of variables being
changed.
>
> I'd like to save code by creating an array and letting
the array change
> the
> variables - However I can't seem to get it to work -
when I use
> document.write
> - the code just appears as text on the browser page.
>
> Can anyone point me in the right direction?
>
> much obliged
> Drew
>

Similar Messages

  • Set SPViewStyle using Javascript

    Hi,
    In my sharepoint site, I have created one custom list with "boxed" style. Also, for Client Side Rendering purposes I add a reference to JS Link which changes few fields on UI for color coding. Somehow after applying this JS Link, "boxed"
    style is getting vanished and view is being shown in "Default" style.
    Is there any way I can re add the style in JS link script or by any other means?

    Hi,
    I can reproduce the issue in my environment, it seems that the JSLink is not compatible with the built-in style of the current view at this moment.
    If you want to apply the “Boxed” style with the custom style defined in JSLink, a workaround is that you can create a completely custom style like “Boxed” style using JavaScript
    within JSLink.
    Here is a link with demo about how to apply accordion style to the list by using jQuery UI plugin for your reference:
    http://www.sharepointnutsandbolts.com/2013/01/using-jslink-to-change-ui-of-sharepoint_20.html
    There are also other plugins in jQuery UI can be used to create custom style for a specific HTML elements:
    http://jqueryui.com/demos/
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they
    help and unmark them if they provide no help. If you have feedback for TechNet
    Subscriber Support, contact [email protected]
    Patrick Liang
    TechNet Community Support

  • How do you rotate a selection using Javascript?

    I am trying to find a simple script on how to rotate a selection using javascript within InDesign CS3. Any ideas!?
    Thanks in Advance!

    Hey!
    Yeah, you can!
    app.activeWindow.transformReferencePoint = AnchorPoint.CENTER_ANCHOR
    or you can check my InDesign Scripting Snippets blog
    http://indisnip.wordpress.com/2010/07/24/rotate-single-selected-object/
    where I explained how it works.
    tomaxxi

  • Use of HTML and Javascript within EP

    I have a newbie question:
    I have several HTMl documents with javascript embedded like e.g. various calculators we use on the current website.
    If I want to migrate these html sources to EP content, what can I best do than?
    I assume that all existing html and javascript renders as normal without too many development involved?
    Is there a good example how-To source which I can use to demonstrate this?
    many thanks for your help

    Hi,
    Well there are two options:
    <b>1) If you are interested to make the portal component and then use in Portal.
    2) If you want to use your earlier HTML document as it is inside the portal.</b>
    In case 1 you need to make the Portal objects and then make a portal project. You can use javascript in that as well.
    In case 2 you can directly make the URL iView of the HTML document and then view it from the portal. Well this is not a good way of using your javascript. Personally I suggest you to go for Portal Project.
    I hope this help you!!
    Regards
    Pravesh
    PS: Please consider reewarding points.

  • How to fit the images within textframe in indesign using javascript?

    Hi,
    We are using the update script for updating the values in table.
    If i am using images within textframe, the table is not fitting after updating it. Without using images the table is fitting.
    First i have dragged the table in Indesign document. Then i have altered the image size and updated the table using Update script.
    Finally i want to fit the table with the resized images.
    Note: I can get the updated values in table . but i cannot get the resized images.( Now i can get the original image after updating the table)
    Please help me if anyone has idea regarding this issue.
    Thanks,
    Vimala L

    Hi,
    Please find below the Update Script,
    var myDocument = app.activeDocument;
    var updateOption = app.scriptArgs.get("updateOption");
    main();
    function main()
    if(updateOption=="UPDATE")
      UpdateLink();
    function UpdateLink()
    myDoc = app.activeDocument;
    myLinks = myDoc.links;
    for (j = myLinks.length - 1; j >= 0; j--)
    myName = myLinks[j].filePath;
      var ext =  myName.substring(myName.length-3,myName.length) ;
    if (myLinks[j].status == LinkStatus.linkOutOfDate)
    myLinks[j].update();
    After running this script i cannot get the image in table.
    While running the Fitting script followed by Update script i am getting the Original size of the image. But i want the re-sized image in table.
    Fitting Script:
    var textFitoption= app.scriptArgs.get("textFitOption");
    var imageFitoption= app.scriptArgs.get("imageFitOption");
    var tableFitoption= app.scriptArgs.get("tableFitOption");
    main();
    function main()
      IterateDocument();
    function IterateDocument()
      for(myCounter = 0; myCounter < app.activeDocument.activeLayer.textFrames.length; myCounter++)
      myStory = app.activeDocument.activeLayer.textFrames.item(myCounter);
      FitPageItem (myStory);
    function FitPageItem (mySel)
      if(mySel.associatedXMLElement!=null)
    if (mySel.constructor.name == "TextFrame")
      if(mySel.associatedXMLElement.xmlAttributes.itemByName("IMAGE_FILE")==null)
    mySel.parentStory.clearOverrides();
      mySel.parentStory.appliedCharacterStyle = app.activeDocument.characterStyles.add()
      mySel.parentStory.appliedCharacterStyle.remove();
    //Fit all inline Items
      graphicItems = mySel.allGraphics;             // I cannot get the graphicItems.
      for(g=0;g<graphicItems.length;g++)
      if(imageFitoption=="Fit Frame To Content")
      graphicItems[g].fit(FitOptions.frameToContent);
      else if(imageFitoption=="Fit Content Proportionally")
      graphicItems[g].fit(FitOptions.proportionally);
      }//for
      }//Has image_file attr
      }//is text frame
       if(mySel.associatedXMLElement.markupTag.name=="products")
      if(IsImageEmbeddedInTable(mySel)==true)
      xmlElem = mySel.associatedXMLElement;
      mySel.placeXML(xmlElem);
      }//if products
    function IsImageEmbeddedInTable(mySel)
      for( var j = 0; j< mySel.tables.length ; j++ )
      table = mySel.tables[j];
      for( var i = 0 ; i< table.cells.length ;i++ )
      cell= table.cells[i];
      cellElement = cell.associatedXMLElement;
      if(cellElement !=null)
      if(cellElement.xmlElements!=null)
      if(cellElement.xmlElements.count()>0)
      if(cellElement.xmlElements[0].xmlAttributes.itemByName("href")!=null)
      return true;
    Thanks,
    Vimala L

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • Problem with using javascript in interactive adobe form

    Hi All,
        I have a problem when accessing text field value which is present inside a subform using javascript.
    I tried giving data.page4.sub-5.<fieldname>.rawvalue but its not working. Please provide a solution.
    Thank you in Advance.

    Since this question is related to JavaScript running within the Form and not the connection between the form and Web Dynpro - it really belongs in the Interactive Forms by Adobe Forum.

  • 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 to use JavaScript to Open a link automatically

    Is there a method (using JavaScript) to allow a user clicked link to open the link through a “intermediary” page?
    For example, say I have a web page with a embedded Flash file that contains links to several different (outside) web pages. The behavior I want is that the user clicks a link (within the Flash file), a HTML window opens (over the 1st HTML/Flash window) with the new content, leaving the original Flash/HTML window displayed in the background. The user reads the new content. The user can then close the newer window and be back at the displayed HTML/Flash file.
    The twist is that the link embedded in the referring Flash/HTML file goes to a “intermediary page”. Call that the “collector” page. I control that page. On that page I have collected (in a list) all the actual outside URLs (I do this so that I can easily change the URLs using HTML rather than having to edit the Flash file.) The Flash file contains essentially the same URL for each outside location (plus a variable unique to a specific URL).
    The user should not ever actually see this intermediary/collector page. Instead, they click the link, a variable is passed from the referring page to the collector page and fires the corresponding link automatically (replacing the content in the newly created window). Since the link fires automatically the content in the new window (initially created by the collector page) changes to the destination content.
    Is this possible?
    What JavaScript functions are used?
    How are the referring links constructed in the Flash so the variable is passed to the collector page?
    How does the “collector” page auto open the actual content?
    If anyone can point me to descriptions on how this might be done I’d certainly appreciate it.
    TPK

    >is there a way i can call javascript without security checking?
    It wouldn't be security if you could just bypass it. Did you read all
    the security notes? You might be able to do something with trusted
    functions, but I'm not sure how that would integrate with a plug-in.
    Aandi Inston

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Scroll() in Adobe Acrobat and Adobe Reader X using Javascript

    Hi there,
    Does someone know how scrolling works in Adobe Acrobat/Reader using javascript?
    The scroll() functions needs two parameters: x and y.
    How are these axises defined? Is this based per page or does the scrolling reference change every time the page changes?
    Why we need to know this? We're making and application in Flash Builder that loads a PDF. External buttons need to call an embedded javascript within the PDF that scrolls up or down.
    Anyone who can provide us with some information concerning this topic: thank you!
    Regards
    Mario

    Well,
    It's hard to formulate: basically we need to understand how the scrolling is handled in Adobe Reader.
    Like: why does the scrolling index change every time you change to a new page. It gets resetted or something.
    Anyway: you cannot create a variable "scrollVerticalIndex" and "scrollHorizontalIndex" and increment it everytime you want to go down or up/left or right and say scroll(scrollHorizontalIndex,scrollVerticalIndex). Also, if you zoom in, the dimension of your page stay the same. We cannot find a way to calculate top or bottom of a document.
    In a perfect world you could say: (height of a page) x ((number of pages)-1) = total height of the document (and thus the total amount you can scroll up/down). But that is just not the case...
    We want to get an insight how the scrolling works :-)
    Does this make sence ;-) ?

  • Using JavaScript to search for dates in PDF

    Hello,
    I have a question about using JavaScript in Adobe Acrobat X Pro.
    I want a script that automatically search dates which fall within one week of the date of today.
    If this is true then the pdf file have to be deleted. If the date is later then one week of the date of today then the pdf file must be moved to a different folder.
    I hope anyone can help me with a solution.
    With regards,
    Robert

    Searching is the easy part. The problem is that a script can't delete a
    file, nor can it move a file to another problem.
    On Wed, Jan 7, 2015 at 8:55 AM, RobertZandberg <[email protected]>

  • Using javascript in a Web app to choose correct webform

    Hi, I've design a javascript function that should in theory call the correct webform when a particular option is chosen in a webapp item.
    The web app is an Event Web App that I made and I want the client to choose whether its a paid event or a free event from a drop down menu and the corresponding webform will appear.
    Javascript and webforms just seem to hate each other.
    My code is :
    <h1>{tag_name}</h1>
    {tag_description}
    <div id="event">{tag_event type}</div>
    <script type="text/javascript">
    var str=document.getElementById("event").innerHTML;
    var n=str.replace("Paid","45008").replace("Free", "10254");
    document.getElementById("event").innerHTML= '{module_webform,'+n+'}';
    </script>
    I know the script should work because I tested it using random words and the string would appear but when I actually put the webform number in
    firebug shows this error:
    <script type="text/javascript">
    var str=document.getElementById("event").innerHTML;
    var n=str.replace("Paid","45008").replace("Free", "10254");
    document.getElementById("event").innerHTML= <!-- CATALYST_ERROR - There was a problem with page modules. Ensure module syntax is correct. -->
    </script>
    Anyone have a solution?

    Hello ChristoRay,
    I'm curious to know if you have got this working? I have not tested this out, but I wouldn't think that you could use JavaScript to dynamically change a module.
    I would think that you could just create a drop down for them called "Free10254 or Paid45008" with the numbers being the values they select.
    Then within the details layout you can have:
    {module_webform,{tag_free10254 or paid45008}}
    This would cut out the need for js.
    Hope this helps,
    Chad Smith | http://bcgurus.com/Business-Catalyst-Templates for only $7

  • Using Javascript in a report region

    I have a text box that I need to populate with an amount for billing. There is also a field that shows the amount due. If the amount due is equal to the amount being paid, I want my user to click on the amount due, and it automatically populates the amount being paid. I am using the javascript:setValue('destination','origination'); command, but the problem is that I am unable to choose the text field in the javascript. I have tried using #value# aliasing, and htmldb_application.g_f0x and just f0x... nothing seems to properly alias the text box within the tabular form. Any ideas?
    Thanks,
    Scott

    Scott,
    I know a way to do this, but it is not an easy implementation and it is quite hard to explain. Carl is an Oracle guy so he may know of a better solution, but here is what I came up with on my own:
    First let's be familiar with the htmldb_item syntax (found in the html db documentation):
    HTMLDB_ITEM.TEXT(
    p_idx IN NUMBER, -- unique id
    p_value IN VARCHAR2 DEFAULT NULL, -- value of item
    p_size IN NUMBER DEFAULT NULL, -- HTML tag attributes
    p_maxlength IN NUMBER DEFAULT NULL, -- max length
    p_attributes IN VARCHAR2 DEFAULT NULL, -- HTML elements including where you incorporate the javascript for this item
    p_item_id IN VARCHAR2 DEFAULT NULL, -- id you can specify
    p_item_label IN VARCHAR2 DEFAULT NULL) -- labe you can specify
    I would create your report region using the following sql statement:
    select order_number "Order Number",
    name "Name",
    amount_due "Amount Due",
    lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Row Num",
    htmldb_item.text(7,amount_paid,null,null,null,'f07_'||lpad((ROW_NUMBER() OVER (ORDER BY order_number)),4,0) "Amount Paid"
    from tbl_orders
    where....
    order by order_number
    --i had to use an order by to get the ROW_NUMBER() to work
    This will create on every row an item that is specific to the row number. For example:
    Row # Amount Paid text box item ID
    1 f07_0001
    2 f07_0002
    500 f07_0500
    etc.
    This will allow you to reference items based on what row they are when using javascript.
    Next you need to create a link out of the the amount_due column. Go to the Report Region, then the Report Attributes tab. Click on the edit link for the amount_due column. Go to the Column Link section.
    Make link_text = to the value of amount_due column(#amount_due# probably)
    Make the Target = URL
    Make URL = javascript: setValues('#AMOUNT_DUE#','#ROW_NUM#');
    This will send the value of amount due and the row number.
    Here's the javascript you would put in your HTML Header on you Page Attributes:
    <script language="JavaScript1.1" type="text/javascript">
    function setValues(due, rownum){
    document.getElementById('f07_'+rownum).value = due;
    </script>
    Give that a shot. I just created a page and got that to work.
    Chris

  • How to use Javascript, C#, or Java to automatically fill out a PDF file using ACROBAT PRO

    Hi.
    I have purchased a copy of acrobat pro and am currently using it to try to create a method of populating certain fields in a PDF file.
    This particualar scenerio is a printable cerficiate, it has a spot for the persons First Name, Last Name, and other basic info.
    So we have an exisiting editable PDF, a database with the user's info, and a ASP.NET web server, and of course Acrobat Pro.
    How can I use these components to create an auto fill script?
    Ideally, we'd genereate these certs on the fly, and allow users to download them.
    A code sample would be awesome.
    Thanks!
    --shawn

    I've discovered that you can create a "PDF Form" and edit that form with Javascript.
    My question now is, what is the prefered method for controlling the pdf form?
    I would like to include the PDF file in an HTML page and edit the form fields using javascript in that HTML page.
    I think that this is how developers are meant to work with dynamic pdf files.
    In the acrobat javascript reference, it only shows an example using the acrobat javascript console.
    If anyone has used Javascript with PDFs, I would highly appricate some input.
    Thanks,
    -- shawn

Maybe you are looking for

  • BEGINNER - NetBeans IDE

    Hi In NetBeans IDE >> Palette Window >> JFrame properties, I set the background color to (for example) blue but when I run with F6 key, the appearing window is always at gray color. Why? Thanks in advance

  • Fixed height of text iView

    Hi all, i want to get a text iView into my page with a fixed height, and if the text increases that limit a vertical scroll bar should apear and not the horizontal scroll bar. i am trying to use <iframe> tag in the jsp and call the html page in that

  • Control sound in timeline

    Hy, I've some mc called, one a time, with attachMovie named mcTarget, each of this has one speaker track sincronized with the animation on the stage. For this reason sound is put directly in timeline in stream mode (proprieties>>Sincr: stream). But n

  • I turn off the phone will not turn to dear, I need the photos...

    I turn off the phone will not turn to dear, I need the photos emergencies because there I have very important information. That I can do to recover photos. I understand that you had downloaded the iCloud but when I Icloud not appear on photos.

  • How to install down load manager on windows

    Guys, Please let me know detailed process of installing download manager. whish java version i need to use? Thanks in advanace.