Hide form field based on name that contains certain characters

I think this is an easy one.
We're looking for help with a script that will hide all instances of text fields that contain a certain value. We have a function running that applies to the same text fields, however, each text field had to be tagged with a number at the end. Also running with this is a custom save button that flattens the page and hides certain elements before saving out. The hide function works pretty straightforward with "this.getField… = display.hidden;". The issue is that we don't want to repeat this for every single instance of the text fields that share the same name.
We need it look for every text box that has a similar title so for instance if we had multiple fields like this…  "my-text-field-01", "my-text-field-02" and "my-text-field-03" we want the script to look for the name "my-text-field" and hide all instances of that.
Hope this makes sense, sorry, our programming skills are still amateur. Thanks in advance for any help.

You can do that if you use a heirarchical naming convention. So instead use something like: my-text-field.1, my-text-field.2, etc.
You can then hide them all like:
// Hide all of the "my-text-field" fields
getField("my-text-field").display = display.hidden;

Similar Messages

  • Show or hide form fields based on cfselect selection

    Hi,
    I'm using ColdFusion 9 and
    I want to show/hide a form field type=checkbox if an assigned value is selected in a dropdown list, but it doesn't work.
    I use a javascript function.
    My question is: Are there better possibilities with ColdFusion to do this or is Javascript the best solution???
    Here is my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist').selectedIndex;      
            if(select == 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <cfselect name="dropdownlist" onChange="show();">
        <option value="0">please select</option>
        <cfloop query="select_select_list">
         <option value="#select_select_list.id#">#select_list.name#</option>
        </cfloop>       
        </cfselect>
    <div id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr style="display:none">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </div>
    </cfform>
    Thank you and best regards!
    Claudia

    Okay, thank you for your answer.
    I changed the javascript function and replaced the <div> with the <table> tag. Then it works.
    Here is an extract of my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist'); 
            var strUser = select.options[select.selectedIndex].value;    
            if(strUser== 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <table id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </table>
    </cfform>

  • Java class names which contain unicode characters

    I need to create, compile and load java classes which have class names that contain unicode characters.
    I am using Win2k but will neet to support unix* in future.
    When I try to create a fooXbar.jar where X is a unicode character which is not ascii I get an error when creating the file.
    My question is: how do I map java class names and package names which contain non ascii characters into
    names that the files systems will like AND that the java VM will use when trying to load .class file from the class path.
    for example what would the .java and .class file be for the following class?
    class \u6587\u66f8 {

    You could make names for .java and .class that is understandable by the filesystem. E.g. you could prepend with % and then digits for the unicode character. The problem is then how to compile the class, and how to load the class.
    You can load the class with a custom classloader, which will translate the unicode class name to the escaped file name (using %).
    The problem is then reduced to how you can compile your code (you have to map the file name to the class name somehow). I think it can be done, but I don't know the solution to that.
    Alternatively you can use meaningful names for the classes, and then make an obfuscator that can change the bytecodes so the classnames are changed to some obscure unicode names. Perhaps there is already obfuscators out there you can use that will use unicode characters.

  • The form field arguments.image did not contain a file.

    Hi there,
    I'm getting a strange error with a simple file upload and I
    can't figure it out for the life of me. It's odd, because old code
    I have written before has worked fine in this area, and I really
    honestly can't see where I am going wrong.
    First the error:
    The form field arguments.image did not contain a file.
    The error occurred in
    C:\ColdFusion8\wwwroot\red_roof_rentals\components\query.cfc: line
    37
    35 :
    36 : <!---<cftry>--->
    37 : <cffile action="upload"
    accept="image/jpg,image/jpeg,image/gif" filefield="arguments.image"
    nameconflict="overwrite"
    destination="#getDirectoryFromPath(getBaseTemplatePath())#\properties\">
    38 : <cfset variables.image = "#file.ServerFile#" />
    39 : <cfset variables.thumb = "thumb_#file.ServerFile#"
    />
    I have researched this and found other people have had the
    same problem - although please be aware that I do not beleive this
    to be an issue with whatever version of CF I am running. I have
    still not found an answer.
    I have one template with my form called
    "admin_create_property.cfm". When the form posts it invokes a CFC
    method that uploads the file and inserts stuff into the database.
    However, it dies at the file upload part with that bizzarre error.
    There are only two files working in this:
    admin_create_property.cfm
    query.cfc
    I will write the code out for these so you can see. Please
    see attached code. Please note that I have taken out as much
    irrelevant code as possible (html, doctypes etc etc).
    Any help with this would be greatly appreciated as I am
    absolutley stumped to be quite honest. I've heard people say it
    could be any of the following:
    1 - Need to use enctype="multipart/form-data" - which I DO
    2 - cffile filefield can't contain ## - which it DOESN'T
    3 - Inut type must be file - which it clearly is.
    Please please help, I feel stupid asking about this but I
    need you guys more than ever!
    Kind regards and thanks in advance,
    Mikey.

    I don't get what you mean as this is what I am doing.
    <cfinvokeargument name="image" value="#form.image#" />
    This takes the value of the image file field and passes it to
    the CFC as an argument.
    Am I doing something wrong with this? Sorry for my
    stupidness!
    Thanks for you help, further assistance would be greatly
    appreciated.
    EDIT: Interestingly enough, if I just use the tag on my
    "admin_create_property.cfm" page instead of using the CFC method
    like this...
    <cffile action="upload"
    accept="image/jpg,image/jpeg,image/gif" filefield="form.image"
    nameconflict="overwrite"
    destination="#getDirectoryFromPath(getBaseTemplatePath())#\properties\">
    It seems to upload the image just fine. Why then would this
    not work if all I am doing is simply passing to the CFC the value
    of the "form.image" as an argument so that the file upload can
    happen in my CFC instead of in the calling template??!
    It's really bizzarre.
    Mikey.

  • Show/Hide JSF field based on SelectOnceChoice using Model Driven List

    Hello All,
    I have a use case where I want to show or hide fields based on values populated in SelectOneChoice. I have View master and View Lookup, master has a field named product which displayed selectiononechoice of product name built using lookup view as accessor. I am storing id of lookup type inside product column. Based on a product name say "abc" I want to hide subsequent fields. Can anyone please tell me how to implement this?
    I am using ADF 11g version 11.1.2.
    Thanks,
    Dipal

    If I understand you correctly, you are trying to show/hide subsequent fields based on the value selected from a selectonechoice?
    Did you try using partial triggers and EL for setting the rendered attribute on subsequent fields and setting autosubmit to true on selectonechoice?
    Kristjan

  • When i open an irc link with a channel name that contains "~" at the end, firefox (14.0.1) opens the same channel name but with "%7E" instead of "~" at the end

    when i open an irc link with a channel name that contains "~" at the end firefox (14.0.1) opens the same channel name but with "%7E" instead of "~" at the end
    http://img835.imageshack.us/img835/2856/clipboard05nq.jpg

    I can not open the image, but I can say something in general about the tilde.<br>
    The tilde "~" is an unreserved character and therefore it can be replaced by its percent-encoded form "%7E" inside a URI without changing meaning. See<br>
    http://en.wikipedia.org/wiki/Percent-encoding<br>
    According to section 2.3 of RFC3986 we should prefer the unencoded form so this behavior seems to be a bit out-dated.<br>

  • Adobe Acrobat X Version 10.1.9 - looking to find out why my form fields, comments, or type that we a

    Adobe Acrobat X Version 10.1.9 - looking to find out why my form fields, comments, or type that we add to our pdf's are not appearing when we send to our clients?

    George, thank you for your help. I actually figured it out!! I need to flatten my documents before I can send them to my clients for signing.
    Take care,

  • To know the table names that contains changed and old PO values.

    Dear All,
            Please let me on the table names that contains changed PO value and old PO value details for which I'll be grateful.
    Regards,
    S.Suresh

    Hello,
    Check the table CDHDR and CDPOS.
    Cheers,
    Vasanth
    Edited by: Vasanth M on Feb 18, 2008 12:08 PM

  • Talking to C# based WinRT components that contain UI features like XAML based user controls from a JavaScript based Windows Store app

    Can you create a WinRT component written in C# that consists of a library of XAML based controls and then used those controls within a Windows Store app using WinJS or via a JS Cordova plugin for Windows 8.1 & WP8.1? 
    Is this possible or can you only use a C# based WinRT component that contains a library of XAML controls in XAML/C# based Windows Store apps? 
    My understanding is that a C# based WinRT component containing non-UI code (i.e. no XAML controls) can be used in a Windows Store app written C#, VB.NET, JavaScript or VC++, but not sure if that principle would work with XAML controls
    wrapped via WinRT types. In theory a XAML control is a C# class, so could work, but not sure how would JS code read that and then launch for example a page or user control from/into its HTML based UI?
    Sandip Ahluwalia

    Right. The code in your app is C# code, but the actual Xaml controls (like the rest of the Windows Runtime) are native code. They are projected into each language (C#, VB, C++ in the case of Windows.UI.Xaml) in a way that appears natural for that
    language and the interop layer is hidden.
    You could expose a Xaml control in a Windows Runtime Component written in any of C#, VB, and C++ to an app written in any of C#, VB, and C++, and the control would appear as a normal C#, VB, or C++ runtime class. This won't
    work for Xaml controls in JavaScript, since the HTML window doesn't have the Xaml hosting infrastructure, but for non-UI code you can write a WRC in C#, VB, or C++ and it will appear as a normal JavaScript class to a JavaScript app.

  • Javascript to adjust form field font size by number of entered characters?

    I have a form field that asks for 'full name' (first, middle, last). It's posted large at the top of the form. Some people's names are short, some long.
    Is there a javascript way to adjust the font size used within a form field based on the number of characters entered into field?
    i.e. if the name entered is Joe Smith, the font size is 30pt, if it's Alexander Hamilton the font size is 20pt?
    Thanks!

    Uhm... because I never noticed that option before! hehe. Jeez.
    Gilad, thx much. That's exactly what I was looking to accomplish.
    (An aside: trying to find a specific Adobe solution or function isn't very easy. I always search the forums, the documentation, and Google before posting any question here. Seems like there are so many features in every product that change so frequently that finding even a simple answer is a challenge...)

  • Word cannot open this document.  The document might be in use, the document might not be a valid Word document,  or the file name might contain invalid characters (for example,\ /).

    I recently upgraded to a new Macbook Air running Lion, from my 2007 white Macbook running Snow Leopard.  I had Office for Mac 2004 on the 2007, but had to upgrade to Office for Mac 2011 to be compatible with Lion on the Air.  Now when I try to open my documents on the Air that were saved under Office 2004 on the old computer, I get the following message: Word cannot open this document.  The document might be in use, the document might not be a valid Word document,  or the file name might contain invalid characters (for example,\ /).
    Any suggestions?  Thank you.

    Ha,ha,ha.....I figured it out.  But for anyone else who's having this problem, it seems that while Office 2004 allowed dates in this format: 00/00/00, Office 2011 doesn't like it at all.  I just changed the format in the document names to 00-00-00 and all is well.  Documents are opening beautifully! 

  • How to make form field read only for users with certain permissions

    We need to make two form fields read only for users with certain permissions. Kindly guide me on how to do this in Infopath. I searched and there is an option to disable to the column, but no option to select user permissions. 
    Please give your suggestion on this. 
    thanks.

    Hi,
    See the link below:
    http://info.akgroup.com/blog-0/bid/69277/InfoPath-Restrict-visibility-to-users-in-a-SharePoint-Group
    Here you can add the fomatting action on the field to disable the field if those users belong to certain Sharepoint group (does not matter the permission levels though). Hope it helps.
    Regards, Kapil ***Please mark answer as Helpful or Answered after consideration***

  • How to Hide Form Field If the data null

    Hi All,
    I have an issue in the RTF, i am working in XMLP 5.6.2 Desktop Edition. I am developing template for Dunning Letter report. I have four fields in the footer like collector name,mail id, tele number and then fax. Here some collectors may not having fax and mail id since these fields are opition in the DFF. So I want to hide the form fields with the labels also if the collectors dont have mail id and fax nos. Now i am getting blank space for the collector who dont have mail id and fax nos. I dont knw what logic that need to apply over here.
    I have the form fields in the template like ....
    <?COLLECTOR_NAME?>
    <?COLLECTOR_MAIL_ID?>
    Tel. <?COLLECTOR_TELE?>
    Fax. <?COLLECTOR_FAX?>
    Please advice me to close this issue.
    Thanks in Advance
    Prabu

    Hi,
    This tag is working if the fax value is not in the xml code. But i am getting blank space
    Cfx, In my report if mail id and fax is not avaliable then it displays like...
    HENRY MICH (Collector name)
    (Collector mail id)
    432-627-9393 (Collector phone)
    (Collector fax)
    I want to display the in my report like
    HENRY MICH
    432-627-9393
    I want to remove the blank space for the mail id and fax if the value is not there in the report.
    Please advice me to resolve this...
    with regards
    prabu

  • Hide Form Field

    I have a form that captures data, the user can sign up as a
    couple or single. On a couple the have to put in 2 names on a
    single only one. I would like the second name field only available
    if they select couple from a drop down or radio button.
    I use ASP/VBScript. How can I accomplish this, is there a
    plug in, or code example I can use, maybe AJAX.
    Thanks

    Check out this JavaScript:
    http://javascript.internet.com/forms/field-show-2.html
    Walt
    "Ken Pollard" <[email protected]> wrote in
    message
    news:gch0uk$6r4$[email protected]..
    >I have a form that captures data, the user can sign up as
    a couple or
    >single.
    > On a couple the have to put in 2 names on a single only
    one. I would like
    > the
    > second name field only available if they select couple
    from a drop down or
    > radio button.
    >
    > I use ASP/VBScript. How can I accomplish this, is there
    a plug in, or code
    > example I can use, maybe AJAX.
    >
    > Thanks
    >

  • How to hide form fields in OIM?

    Hi,
    i want to customize OIM so, that a user see only the form field "create user".
    The form field for Role, Organization and Autorization Policies" should be disabled/hided for designated user.
    Is it possible to manage this over autorization policies?

    The set of links for users, roles, organizations and authorization policies are defined in the web application. Authorization policies only define which ones are accessible or greyed out. Selection links are always shown, with authorization policies only defining which objects are retrieved by the search.
    If you want to remove the links altogether you will need to modify the web application oim.ear.
    Edited by: duncandb on Jun 15, 2012 6:15 AM

Maybe you are looking for

  • Language Translation in BOXI

    Hi, I have developed the WebI Report in english language. I have users from other countries where they want to view the report in other languages. When the user change the Infoview Web browser Preferences to Spanish, the report is still visible in En

  • Mac Book Pro is stuck

    Hi - I see the spinning busy ball for hours now. cmd+alt+esc does not work. any idea? Thanx

  • ALE using PULL Approach question

    Hello All,               Can anybody  explain me the sep-by-step process for getting the material master using BD11- PULL approach. I had already configured the Distribution model for sending the request MASFET in system B, from which we are requesti

  • Developing Iphone App using Flash Builder and Flex Air Mobile

    I started developing an Iphone app using the trial version of Flash Builder and was pretty impressed with how easy it was, then i hit problems: Trying to submit my app, I was getting invalid binary, using google i tracked this down to a change in the

  • Deleted pictures in "originals".

    Hi, after restoring iphoto with time mashine some photoes disappeared in the folder "originals". These were photoes I by mistake had stored manualy in the folder "originals" without importing them to iphoto first. Does anybody have any idea how i can