Stripping out dashes from variable

I have a jsp page that dynamically build a list of select boxes based on information out of a record set. As I build the select box I am including an onChange function that submits the form once the user selects something from the drop down list. Basically it looks like this: out.println("<select class='select' name='"+selectName+"' onChange='document."+formName+".submit();'>");
Az you can see the select name and formname are also dynamically added based on the record set return. My problem is in the database there are dashes in some of the data so I am getting something that looks like this in my resulting html: select class='select' name='A-10' onChange='document.A-10.submit();'>");
This dash is causing the onChange to not work so I need a way to strip out the dash so that the results would be A10 as apposed to A-10
Any thoughts??
p.s. This is how I filling the variable:
String selectName = request.getParameter("name");
String formName = request.getParameter("DataSet");

first of all, I dont understand why you use multiple forms on one page, but thats just me. Second, you can use
documents.forms[0].submit() to avoid the names. So just loop through your forms and use
out.println("document.forms[" + i + "].submit()");

Similar Messages

  • Stripping out data from unstructured documents

    I have hundreds of word and html documents that I need to strip out certain information. The html docs are completely unstructured. The word documents may or may not have the same structure. How can I leverage PL/SQL to extract out the data that I need? I have seen scripts where using PL/SQL you can give a byte position number. This may work for extracting out some of the data if positioned in the same place but I am looking to simplify the process and get the right information out in one pass. Any help would be greatly appreciated. I am not necessarily looking for an exact answer but rather information that can lead me in the right direction. Of course the exact answer wouldn't hurt.

    I read all of the thread for that particular post and I still don't believe I have what I need.
    Maybe it is the instr function that you wanted me to look at and maybe not. I just don't know how I would use that to extract data.
    What I am looking to do is to use some kind of PL/SQL statement to extract a unique identifier that will be in the document, dates that the document was created or appended, and then some region numbers. So can I use instr to find a value from each document, hold it in a flat file and then import this information back into the database? The value of course will be different in every document.
    These files are currently not in a database. I am trying to get this information out of the document to store as metadata for each document. Am I looking at the right way to do this using PL/SQL or is there some other method of data extraction that I should consider

  • Stripping out html from form submissions

    My web developer is using the attached code to strip/disallow
    html code from form submissions in an effort to prevent someone
    from posting dangerous scripts or code via a form or blog.
    Problem is, I DO want to at least allow people to post url
    links to external content like youtube videos, their own webstes,
    images etc.... Basically if it is something hosted AND viewed on a
    site other than mine I would like to give them the ability to link
    to it. How could I edit the code to allow links of this nature or
    is there a better way to do this?
    My developer has basically told me there is no other way. It
    is either disallow it all or open it up. I disagree with this and
    am looking for a 2nd opinion.

    url links are not html.
    Regular expressions are not my strength, but it looks like
    that function is simply replacing sets of angle brackets with empty
    strings.
    In other words, if your users submit
    http://somesite.com, that will not
    be affected by the function. However, if they submit <a href="
    http://somesite.com">, it will be
    transformed to href="
    http://somesite.com". In either
    case, it will be text, not a link.

  • How do you strip out certain groups of characters from a String variable

    for exapmle...
    String date = "11-Feb-2005";
    String day;
    String month;
    String year;
    how would you strip out '11' from date to assign it to 'day', and 'Feb' to assign it to 'month' and '2005' to assign it to 'year'.
    in my program the variable 'date' will always be in the format of:
    ist two digits are numbers followed by '-'
    then three digits (letters) followed by '-'
    then four digits that are numbers.
    i think it has something got to do with charAt or something, im not sure how to do it.
    any ideas?

    yea i tried the first method and it works fine.
    thanks very much.
    also... i tried the other one and it outputs... 11 1 2005
    which means it works but you see i wanted to put the date in the format of...
    Calendar date = new GregorianCalendar(2005, Calendar.FEBRUARY, 11); so i can compare it to another Calender object to see which one is earlier.
    that is why i am doing it like this...
    Calendar date = new GregorianCalendar(+ year + ", Calendar." + month + ", " + day);
    for example...
    Calendar xmas = new GregorianCalendar(1998, Calendar.DECEMBER, 25);
    Calendar newyears = new GregorianCalendar(1999, Calendar.JANUARY, 1);
    // Determine which is earlier
    boolean b = xmas.after(newyears); // false
    b = xmas.before(newyears); // true
    anyways i am just curious.

  • How does one strip out all Live Cycle data from a PDF and rebuild the form fields in Acrobat?

    Someone in a different department built a bunch of forms in Live Cycle. We now need to make minor edits to these forms but we all have Macs and can't use Live Cycle. Currently our only option to change a date and a name on each form  is to buy a new Windows workstation, buy a copy of Live Cycle and train someone for it.
    I understand the Live Cycle technology and Acrobat technology for forms are somehow different but there must be a way to just strip out all the Live Cycle form programming so that I just have the bare PDF with the text and layout.  Then make the text edits and rebuild the form fields in Acrobat.

    It depends on your PDF. Is the PDF a static XFA or a dynamic XFA?
    You can check to see if the PDF is static/dynamic by clicking File=>Save As, and it should say static or dynamic PDF as file type.
    iText will work with Static XFA forms created in LiveCycle. Dynamic XFA forms are not supported.
    You can also submit XML data to a server side script and parse the XML data using C# system.xml.xmlreader.
    Another tool that may speed the development of the project is:
    http://www.fdftoolkit.net/
    Note: FDFToolkit.net utilizes iText Technologies.

  • Backslashes getting stripped out of my regex

    I am trying to automate some find/replace routines in dreamweaver using javascript.
    dreamweaver.setUpFindReplace({ 
            searchString: '<table width="\d+', 
            replaceString: '<table width="100%"', 
            searchWhat: "document", 
            searchSource: true, 
            useRegularExpressions: true 
        dreamweaver.replaceAll();
    This query gets passed as: <table width="d+
    Problem: when the query string is passed to the setUpFindReplace object, the backslashes get stripped out. Backslashes are key to regular expressions. How do I get them passed from JavaScript to Dreamweaver?
    I am using CS6
    Ben

    I am still looking for a smart person to answer, but in case anyone else is having same problem I found a work-around.
    I think Java uses the backslash as an escape character and so it is not passing it to Dreamweaver. The only thing I found that works is to set a variable with the regex text, and escaping all the backslashes, then passing the variable to Dreamweaver.
    var myFind = '<table width="\\d+"'
    dreamweaver.setUpFindReplace({
            searchString: myFind
            replaceString: '<table width="100%"',
            searchWhat: "document",
            searchSource: true,
            useRegularExpressions: true
        dreamweaver.replaceAll();
    Note: double backslash \\d+ and single quotes ' " " ' used because query string contains double quotes.
    I tried escaping the double quotes in the search string \" but this did not work for the same reason.
    Ben (not a Java developer)

  • DVCProHD frame rate converter strips out audio?

    Hi,
    We are doing a capture of DVCProHD material from DVCProHD tape. They are all coming in as DVCProHD 59.94 with 23.98 flag. Unfortunately when we captured, we captured everything as DVCProHD 59.94 with no pull down.
    We are hoping to remove the duplicate frames after the fact, and tried using the DVCProHD frame rate converter tool in FCP. However, upon reading and re-writing the file, we find that FCP strips out all the audio of the original file.
    I am wondering if there is a way to remove the duplicated frames and at the same time maintain the audio tracks on the new 23.98 file.
    Thanks!
    Michael
    <Edited by Moderator>

    make a copy of your captured media and "conform" it in cinema tools. this will keep the audio but is destructive to the file thus you'll want to work from a copy in case you mess up. the frame rate convertor used to be used for variable speeds ie 48 over 24 for half speed thus thee audio would never sync and thus the FRC doe not process audio

  • How to user PowerShell -replace to remove the dreaded em dash from a file name?

    I have a bunch of .msg files in a directory and want to zip them up (to send them to our spam filtering company), but I keep getting errors on file names that contain the em dash (—).  I believe it's (char)0x2014.
    [edited]... the correct syntax is [char]0x2014.
    I wish to eliminate the em dash in the file name but I can't seem to find anything on the web about replacing em dashes.  When I paste '—', PowerShell replaces it with a '-'.
    I found this neat function that does a great job replacing multiple characters within a string.
    http://powershell.com/cs/blogs/tobias/archive/2011/04/28/multiple-text-replacement-challenge.aspx
    I am using the below code for my string replacement.
    Thank you for your help.
    function Replace-Text {
    param(
    [Parameter(Mandatory=$true)]
    $text,
    $replacementlist = "(-,,',,%,,$,,@,,#,,&,,’,"
    Invoke-Expression ('$text' + -join $(
    foreach($e in $replacementlist.Split(',')) {
    '.Replace("{0}","{1}")' -f $e, $(
    [void]$foreach.MoveNext()
    $foreach.Current)
    $path = '<path>'
    Get-ChildItem -Path $path | Rename-Item -NewName {(Replace-Text $_.Name).trim()}

    Here is a simple filter that will strip out all nonprintable chanracters.
    $newname=$file.Name -replace '[^a-zA-Z\.]'
    I just tested it on Win 7 which supports has a Unicode filesystem and it successfullstrips the bad characters.
    We also need to do this on files uploaded to SharePoint and OneDrive.
    The ~ and other similar characters are not allowed in may systems.  You should keep a translation log and tag all renamed files with some obvious tag.
    ¯\_(ツ)_/¯

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • How to strip out leading numbers in auto-generated bookmarks?

    For years now my team has used an Acrobat plug-in called Compose, which lets us strip out the leading numbers from bookmarks in PDFs generated from FrameMaker 7.2. (The tool works after the fact, so that all bookmark creation occurs after the PDF is created.)
    For example, these document headings:
    1.1 Intro to Happy Fun Ball
    1.1.1. System Requirements
    1.1.2. Cautionary Information (WARNING)
    are translated to the bookmarks:
    Intro to Happy Fun Ball
    System Requirements
    Cautionary Information (WARNING)
    After evaluating the new Adobe Tech Comm Suite, it seems that Acrobat 9 Extended Pro isn't compatible with the Compose plug-in (or at least, the version we've been using for years).
    Does anyone know if there's a method -- built into either FrameMaker 8 or Acrobat 9 Pro Extended, or in an SDK -- that allows you to auto-generate bookmarks but strip out leading numbers? It seems this is a no-brainer of a feature, yet I can't find it listed anywhere in the Acrobat documentation.
    Other names for this feature might be "wild card" or "text masking," not to mention "strip leading numbers."
    Thanks very much for your help.
    Regards,
    Buster

    The following code can be run from the JavaScript console, but since you're new to this, it might be easier to create a button, paste the code shown below into the Mouse Up event of the button, select the Hand tool and click the button to execute the code, and then delete the button if everything is OK.
    If you need to do this a lot, you should consider setting up a custom menu item or toolbar button that executes this code:
    function removeBookmarkPrefix(bookmark) {
        // Resursive function to remove bookmark prefix
        // Rename bookmark without prefix
        bookmark.name = bookmark.name.replace(/^\S+\s+/, "");
        if (bookmark.children != null) {
            for (var i = 0; i < bookmark.children.length; i++) {
                removeBookmarkPrefix(bookmark.children[i]);
    // Remove all bookmark prefixes, recursively
    removeBookmarkPrefix(bookmarkRoot);
    The code uses what's called a regular expression, which in this case is fairly simple: /^\S+\s+/
    This regular expression means to search the bookmark name for the beginning of the string (^), followed by one or more non-whitespace characters (\S+), followed by one or more white space characters (\s+), and replace all that with an empty string (""), thus removing it. This should work with the bookmark name prefixes you describe.
    The function is called recursively, which is an efficient way to handle the hierarchical structure that the bookmark tree can have.
    If you get stuck, post again.
    George

  • Third Party Plugins Stripped Out After Editing/Saving

    Hello All,
    I'm really hoping someone can help.
    Ok here's the tech stuff:
    Workflow-
    Mac - OS 10.4.9, InDesign CS3 5.0.2
    Windows - XP InCopy CS3 5.0.2
    Plugins used in InDesign (Mac) AutoPrice (Meadows Pub.) & Sonar Indexing (Virginia Systems)
    These 2 plugins are vital to our Catalogs.
    What I'm seeing,...
    I export stories (copy blocks) in InDesign for editing in InCopy on the Windows Machine.
    I open up the same document in InCopy (windows) to test, edit some copy, save, check in, close.
    Now, open this same document again in InDesign (Mac), copy updates needed, update the copy, but wait! all of the Third Party Markers are gone!
    Everything that was tagged, or marked for the Index, and all the Pricing Tags are gone.
    I've found out when the InCopy document is saved, this is when this happens. It strips out all Third party invisible text, placeholders, etc...
    WHAT???
    I can't believe we're the only one's in the world having this issue. And its hard to believe Adobe would even do this.
    I've talked to both Plugin Companies about this, One thinks this is a Bug Issue on Adobe's end.
    The other, is trying to work out something to stop this from happening.
    Ok,... So we're ready to move to a InCopy workflow, but now this. I need HELP!
    We can't implement InCopy when it destroys our vital information,....
    Thanks for any help on this,
    Christopher

    Hello All,
    I'm really hoping someone can help.
    Ok here's the tech stuff:
    Workflow-
    Mac - OS 10.4.9, InDesign CS3 5.0.2
    Windows - XP InCopy CS3 5.0.2
    Plugins used in InDesign (Mac) AutoPrice (Meadows Pub.) & Sonar Indexing (Virginia Systems)
    These 2 plugins are vital to our Catalogs.
    What I'm seeing,...
    I export stories (copy blocks) in InDesign for editing in InCopy on the Windows Machine.
    I open up the same document in InCopy (windows) to test, edit some copy, save, check in, close.
    Now, open this same document again in InDesign (Mac), copy updates needed, update the copy, but wait! all of the Third Party Markers are gone!
    Everything that was tagged, or marked for the Index, and all the Pricing Tags are gone.
    I've found out when the InCopy document is saved, this is when this happens. It strips out all Third party invisible text, placeholders, etc...
    WHAT???
    I can't believe we're the only one's in the world having this issue. And its hard to believe Adobe would even do this.
    I've talked to both Plugin Companies about this, One thinks this is a Bug Issue on Adobe's end.
    The other, is trying to work out something to stop this from happening.
    Ok,... So we're ready to move to a InCopy workflow, but now this. I need HELP!
    We can't implement InCopy when it destroys our vital information,....
    Thanks for any help on this,
    Christopher

  • In Photoshop CS6, Save for Web strips out my filename after a period "." character

    I have a file named label-1.5oz.psd.  In Photoshop CS6 when I use "Save for Web" to save it as a JPG, it only wants to save a part of the filename: label-1.jpg
    I strips out everything after the period "." character.  I know it's incorrectly thinking that's a file extension.
    Any ideas how I can fix this?  Any settings I should tweak?  I'd really love for it to save the full filename without requiring me to retype the last part every time.
    Thanks in advance for any help!

    Oh if only it were that easy...  Unfortunately, they have to be cropped and resized, converting over from a print catalog where much of that work was originally done in InDesign, and now have to convert each individual image to make the web site look like the catalog...  but thanks for the suggestion, have already tried to automate what I could..  But much of this is going to be hands on...  getting my familiar quick keys to function correctly would help greatly.

  • XI 2.0 Inbound message to XI has XML Tags Stripped out

    Hi
    We are developing an XI 2.0 application.  A message is sent from a 3rd party company over a VPN and routed to our XI box.
    On receiving the message, XI tries to carry out the message mapping. However it fails because it does not like the content of the message. When I check the message content (View -> Source) we see that all the XML Tags have been stripped out somehow. Only the actual data field contents remain, in a big string. So obviously the mapping fails.
    If I run the same scenario, but send the message from a JMS Test Client on my PC and route it to the XI box everything is fine and the message retains the XML Tags.
    The messages route through the SAP Adapter Engine in XI.
    The 3rd party company say the message does contain the tags when it leaves their systems.
    Has anybody come across this scenario? Would any settings in the SAP Adapter Engine force the XI tags to be stripped? Any suggestions would be very welcome!
    Many Thanks
    Jaime

    Hi Jaime,
    The visual J2EE administrator is the standard administrator tool of any SAP WEBAS system so it is not a specifc XI tool.
    Typically your SAP WEB AS basis administrators use the tool to configure the J2EE part of the SAP WEB AS.
    SAP OSS note 76921 has all the details on tracing the XI adapter framework for version 3.0 - might be usefull for version 2.0 as well ...
    Regards,
    Steven
    BTW - are you that Diagonal bloke with whome I have been on a project for a client in Rozenburg, Netherlands ? I was that SAP BC B2B bloke

  • Varying result set and binding parameters in sqlcmd from variable

    SSIS  - Support of Multiple versions of our product
    Our Enterprise Data warehouse consolidates data from multiple data sources.  We have a requirement that we should be able to support data collection from different version of these data sources at the same time.
    Ex. Customer has three different versions of our product installed 7.3,  7.3.1 and 7.3.2. The data warehouse would in this case would be on version 7.3.2, but should be able to collect data from prior versions of the data sources.
    We use stored procedures to collect data from sources into our staging area and then we transform and load it on to the warehouse. The design of SSIS packages are that, there is one main package that executes packages for each table that we collect data
    from the source. The main package is invoked per source that we need to collect data from, if there are three sources at run time there will be three instances of the main package running. These packages run on the warehouse machine to pull the data from the
    source system.
    We would like to maintain one version of these packages on the warehouse and support collecting data from different source versions.
    Challenges
    The signature of stored procedures on the source system has changed between versions
    There are some additional fields returned by these stored procedures in the newer release
     Example
     7.3 version signature :
    [dbo].[PDW_GetMediaAgentSummary](@LastVersionID
    AS BIGINT,
    @InitializeDays as
    INT = 60,
    @NextVersionID AS
    BIGINT OUTPUT)
    7.3 Sp1 version signature:  [dbo].[PDW_GetMediaAgentSummary](@LastVersionID
    AS BIGINT,
    @DataStartDate AS
    DateTime2(3),
    @NextVersionID AS
    BIGINT OUTPUT)
     Also, let us say in 7.3 this stored procedure returned 8 fields and 7.3 sp1 it is returning 10 fields.
    The way we are trying to accommodate is to use “SQLCmd from variable” option in the OLE DB source to cover the signature difference, but this option does not allow us to bind parameters
    to variables to get the output value. The second issue of additional fields (or the lack of additional fields from the 7.3 procedure), we tried to turned off the metadata validation, but we get field not found error at run time when we run the SSIS package
    against 7.3 version. Looks like the only way we could solve is to duplicate the data flow tasks, based on the source version. Looking for better way to do this, since this could go out of control as the number of releases increases.
    Appreciate help on this.

    I suggest you branch your package into one route vs another based on some flag that indicates version the package is connected to then it will execute one stored proc or another, this can be done
    using the Precedence Constraints, or make a wrapper stored proc that hides the data differences between the versions.
    Arthur
    MyBlog
    Twitter

  • How to find out where a variable has been used?

    How can I find out where a variable has been used within a package/interface/procedure?
    Should I check it using repository's internal tables?
    Thanks

    Hi,
    you have to make some queries to find variable used in which ODI object.
    like, it fetch the variable with scenario name and scenarion can serve your need.
    select v.i_var,v.var_name,s.scen_name from
    ODEV91119_ODI_WORK.snp_var v,ODEV91119_ODI_WORK.snp_scen s
    where
    s.i_var=v.i_var
    and s.scen_NAME='V_BTCH_NAME'
    and agree with SH answer
    Thanks

Maybe you are looking for

  • Installing sap netweaver 7.0 ehp1

    dear all im working in omnix international llc Jordan company i need to install netweaver 7.0 ehp1 i recently received the DVD which its 30dvd with the ERP 6.0 and oracle database and with blue-ray 25 giga that contain solution manager i think that t

  • Photoshop CS3 Initialization Error

    Successfully installed & activated Photoshop CS3  on a new PC with a fresh Windows 7 Pro 64bit installation, along with Photoshop CS3 10.0.1 & Bridge CS3 2.1.1.9 updates.  Bridge runs fine, but Photoshop returns the following error when attempting to

  • How to copy a pdf file from a windows PC to an iPad?

    how to copy a pdf file from a windows PC to an iPad?

  • How can I track what my employee is looking at in private browsing?

    An employee of mine is constantly using Private Browsing, and considering the rest of my staff uses the regular browser, I'm finding it quite suspicious. Please inform me how I can track the pages he is visiting as all of the history is deleted when

  • SAP IS-Retail and Production process

    hi experts, i am working on SAP IS-Retail. We have a scenario like our retail client is basically deals with FMCG, Footwear, White goods, Fashion related Items. In these items some of the items are inhouse produced. So in this scenario how can we pro