Two fields from one dropdown

Based on the selection for department, I want to update the
branch field with the department name and dept_color field with a
color code in an Access database. How can I do this with just one
selection? I am assuming I need some sort of "If Then" Javascript,
but I was unable to code this myself.
Here is the insert record statement (briefly):
If (CStr(Request("MM_insert")) = "add_event") Then
MM_editConnection = MM_intranet_STRING
MM_editTable = "vacations"
MM_editRedirectUrl = "calendar_add.asp"
MM_fieldsStr =
"employee|value|branch|value|vacation|value|comments|value|approved|value"
MM_columnsStr =
"employee|',none,''|branch|',none,''|vacation|',none,NULL|comments|',none,''|approved|',n one,''"
This is the selection code that udpates branch:
<select name="branch" id="branch">
<option value="02 Main">Main</option>
<option value="03 Montpelier">Montpelier</option>
<option value="04
Lyndonville">Lyndonville</option>
<option value="05 Colchester">Colchester</option>
<option value="06 Orleans">Orleans</option>
<option value="97 IT" selected>IT</option>
<option value="98 Support Services">Support
Services</option>
<option value="99
Admininstration">Administration</option>
</select>
I have a hidden field for dept_color, but I do not know how
to set the value based on what is selected in the dept_name field.
Help would be appreciated!
Sherry

Hi CVLOH:
You can write a function like this one into the JavaScript
area of the document head and then call the JavaScript from the
select list:
function setColor() {
if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Main") {
document.<formName>.dept_color.value = <color1>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Montpelier") {
document.<formName>.dept_color.value = <color2>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Lyndonville") {
document.<formName>.dept_color.value = <color3>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Colchester") {
document.<formName>.dept_color.value = <color4>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Orleans") {
document.<formName>.dept_color.value = <color5>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "IT") {
document.<formName>.dept_color.value = <color6>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Support Services") {
document.<formName>.dept_color.value = <color7>
else if
(document.<formName>.branch[document.<formName>.branch.selectedIndex].text
= "Administration") {
document.<formName>.dept_color.value = <color8>
in the Select List apply the Call to JavaScript client
behavior to call the function so that the hidden form element value
will be set whenever you change the value in the select list. The
function call to enter in the javascript field is
setColor();
<select name="branch" id="branch"
onChange="MM_callJS('setColor();')">
enthusiastically,
mark haynes
webassist sales
check out our special offers at:
http://www.webassist.com/professional/products/specials.asp

Similar Messages

  • How can I place two fields from one column side by side?

    Hello experts,
       I need your help: I have a column which has two different fields. One is Sales, the second is Sales Todate.
    My boss want me to get the difference btn them as well as the percentage. Now, here is my challenge: I can easily filter them but I want them to be side by side; but when I filter one appear on top of the other like below
    Sales                           
    Sales
    Sales
    Sales
    Sales
    SalesTodate
    SalesTodate
    SalesTodate
    SalesTodate
    SalesTodate
    However, I want them appearing like below:    that way, I can place the difference column beside them.
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Sales
    SalesTodate
    Any help will be appreciated..  I have tried a case statement, still the problem persist
    Chuck
    On the side: Does anyone know how to place the question in such a way when one answers I can mark correct or helpful, I am still not able to.. I hate it, when I place a question I go through create then discussion, is that the right way?

    Hi
    Just drag the column to measure label area in pivot table @ columns.
    So the table has to drag and drop to column area on the top so it will get display like
    Sales     SaleToDate
    And the measure label to row side drag and drop it
    sales      saletodate
    values     values
    Regards,
    VG

  • Call two programs from one program.

    HI all,
    I have two BDC interface in seperate programs.
    I want to call that two programs from one program based on a condition.
    Is there any way.
    I tried with call transaction 'SE38'.
    set parameter ID but it is taking buffered value.
    Thanks,
    sri

    use submit program to call other program.
    SUBMIT prog|(field) [AND RETURN] [options].
    also if you want BDC prog, then probably you can call the BDC recording using PERFORM bdc_prog (in program name).
    PERFORM (<fsubr>)[IN PROGRAM (<fprog>)][USING   ... <pi>... ]
                                           [CHANGING... <pi>... ]
                                           [IF FOUND].
    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9dd035c111d1829f0000e829fbfe/content.htm

  • Get value of two fields into one field

    Hellou,
    i need little help with javascript again
    Currently i'm using code below to get value from one field to other:
    getField("Text35").value = getField("Text1").valueAsString;
    Now i'm wondering how to change this code, so i could get values from two fields into one. For example i have field "firstname" and field "lastname", now i want to show this in field "name".
    Example, if field firstname have value John and field lastname value is Doe, i want to show it in field name like "John Doe".
    I hope that u understood what i want
    Thanks for helping me!

    getField("Text35").value = getField("Text1").valueAsString + " " +
    getField("Text2").valueAsString;

  • Booting two Macs from one external drive: 10.8 and App Store?

    I boot two Macs from one external harddrive. Does this mean that when 10.8 is sold exclusively via the App Store and thereby linked to a unique hardware identifier, I am going to have issues with activation/authentification each time I switch machines? I have avoided the App Store since I discovered that an app I bought there, and which I really needed to open automatically on log-in, had to be manually re-activated with my Apple ID after every switch (so that I eventually deleted it and reverted to an earlier, non-App Store version).

    Welcome to the forum!
      There are a couple of "solutions" to your problem.  The easiest, and possibly the best for you (although it is a bit slower) is to copy your catalog onto the external drive as well.
    Then when you plug in the drive, you will always have your latest catalog for access.
    The other way is to keep a local copy of your catalog, and copy it onto the local drive as a way to transfer it from one computer to the other.
    This has the problem of possibly not being in sync, that is, you forgot to copy it over once and did some editing.  Then you would end up with essentually two different catalogs, instead of one in two places.
      You can copy the catalog either with your OS, or you can "export as catalog" and specify the external drive as the destination.  Then, on your other computer, "import from catalog" and only take the meta-data settings (it's on the import dialog box).
    Personally, when I'm traveling, I have my catalog on my external drive as well.  It just makes life easier, and I don't have to worry about it being out of sync, or losing it (and not the images).
    So, I would go with the first method, at least to start.  To get your catalog over there, you can either export as catalog or copy it, either one will work.
    You can find the location of your catalog file (if you don't know where it is) in the catalog settings menu prompt.  Both the location and the name will be displayed.
    Cheers!

  • Copying Fields from one PDF to an Updated PDF - can't move fields on destination pdf

    I'm using Word as the authoring software for a PDF.  In version 9, I never had problem copying fields from one to another.  But in Version 11 I copy them to the new revised form and the fields won't move.  I can't move them with the mouse or the keyboard arrows.  I do see a bunch activity in the right pane called fields (tab order) but the fields don't move.
    Any help understanding why and how to solve is greatly appreciated.
    Thanks in advance for your time and experience.

    Highlight all the fields with CTRL +A, click on properties, and uncheck "Locked"  in the bottom left.

  • Duplicating form fields from one PDF document to another

    Hi,
    Does anyone know of a way to select and duplicate all acrobat form fields from one PDF document into a new PDF document. I know I can do so one field at a time but would like to know if there is a way to do so in a wholesale fashion.
    Our PDF documents are created in-house each year and are nearly the same as the previous year's document containing 99% of the same form fields in the same locations. These forms contain a lot of form fields, anywhere from 50 to 100 fields.
    Rather than start from scratch each year defining the same fields that were present in the previous year's document, I am looking for a way to copy the form fields from an existing PDF document (last year's PDF in our case) and copy the form fields into a new PDF document (that does not yet have any form fields defined) and hopefully maintain all the field attributes and positions from the previous years document.
    Thanks for any suggestions,
    Steve

    The PDF template we need to copy the form fields "to" doesn't start out having any form fields. It is the fields that we need copied from a previous year's PDF template.
    Here's an except from my original post: "I am looking for a way to copy the form fields from an existing PDF document (last year's PDF in our case) and copy the form fields into a new PDF document (that does not yet have any form fields defined)"
    The "new" PDF template is a complete "paper" form with updated legal text and calendar year referrences but NO form fields. In our IS group, we then take these forms, add form fields to them and are then able to populate them with database-resident user data. We serve them up to the user in their browser pre-populated with their application data.
    So again, our need is to find a way to copy form fields from "last year's" PDF template and copy just the form fields to an fresh "new year's" PDF template that contains no form fields to begin with. What we begin with is just a PDF representation of a paper student loan application.
    Thanks for the suggestion!

  • HT1347 How do I run two libraries from one computer?

    How do I run two libraries from one computer? One library is on the computer's hard drive, the second library is on an external hard drive. The computer that had the external hard drive crashed and I need to fix the iTunes library on it. How can I do this without corrupting the library on my internal hard drive?

    Launch iTunes with the Shift key held down and either create a new library or choose the one on the external drive. Any rented movies downloaded from another computer won't play.
    (81212)

  • HOW to copy Form field from one RTF to another RTF

    Hi Expert
    I have developed 20 reports in BI Publisher which is using xml as data source. So to access the data i have done the xml coding for each form field.
    Now i want to copy the form field from one rtf to another, while doing the copy paste of the form field from one rtf to another it is not copying the xml coding. It is appearing in the new rtf as below
    <?ref:xdo0391?>
    Can you guys suggest me how to achieve the same. Is there any setting need to be changed so that while do the copy paste the form field it will copy the backend code also.
    Thanks in advance.
    Thanks
    Srikant

    make your template set as backward compatabile before you do anything on template. load the xml and then copy the form field. it should work. dont try to open the field without loading xml.

  • What is the prerequisite for creating two hierarchies from one fact table i

    Hi,
    what is the prerequisite for creating two hierarchies from one a single fact table.
    Rgds,
    Amit

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • Move fields from one table to another

    Hi,
    I would like to move fields from one internal table into corresponding fields of another internal table.
    move-corresponding syntax seems only to work with structures. How do you accomplish this for internal tables? Do I have to use for loops?
    regards
    Baran

    Yes you have to use loops and move-correspoding statements unless you have all the common fields in the same order on both internal table and no different fields to the left most.
    eg:
    data: begin of itab1 occurs 0,
             field1 type i,
          end of itab1.
    data: begin of itab2 occurs 0,
             field1 type i,
             field2(1),
          end of itab2.
    do 5 times.
    itab1-field1 = sy-index.
    append itab1.
    enddo.
    itab2[] = itab1[].
    loop at itab2.
    write:/ itab2-field1.
    endloop.
    The above code would give you some idea.
    Regards,
    ravi

  • My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?

    My iPhone just loaded 1600  emails dating back over two years from one of my accounts. Is there a way to "mark all as read"?

    Your Comcast accounts are POP (unless you enrolled in the Comcat Beta test of Imap) so they won't sync at all. Either enroll in the Beta test or don't use Comcast.
    Your iCloud account is Imap and should sync just fine, unless you have set it up incorrectly.

  • HELP!  JOB ON THE LINE-  Need to import fields from one document to another document

    In a nutshell I have a set of documents and we now have a new structure for those documents. Either I have to cut and paste all the data from one to another or figure out how to import fields to another document.
    I have two documents. Both are different but require the same information. Basically I need to have one file with fields import specified fields from another document. Ex., Name on document 1, I need the file to know to get the Name field on document 2 and import it into the specified field on document 1. I will have multiple fields that need to do this importing. I REALLY NEED TO FIGURE THIS OUT B/C I HAVE A TON OF DOCUMENTS THAT NEED TO BE COMPLETED.

    If you are talking about the field structure, not the content that Bernd commented on, make a copy of the document with the fields. Open the file and use replace pages to replace the pages with the new document layout. After you have replaced the pages, you will have to select the field tools and move the fields to the proper location. If the form was made in Designer, I am not sure of the process. There is likely a similar process in Designer, but I don't use Designer and can't comment. You may have to go to the Designer forum in such a case, unless other Acrobat users here can help.

  • Two objects from one table

    My current setup is two tables and two objects with a one to one relationship between them, Object and ObjectMD (metadata).
    Not sure why my predecessors set it up like this but...that's how it is.
    The problem is that my Object table (and thus ObjectMD also) has reached 40 million rows and large joins between Object and ObjectMD are taking forever and are completely unnecessary.
    I want to import the ObjectMD data into the Object table and go forward with a single table. The problem is that the ObjectMD table has it's own java surrounding it and that code is used in way too many places to weed it out. I need to leave the Java object structure in place.
    I think I should be able to create both these objects from a single table, but I can not figure out the descriptor. My set method needs to be getMetaData().setMethod, but of course TL's reflection doesn't like this. I suppose I could create new methods in Object to get/set all these fields and just forward them to the real methods.
    How can I define descriptors to create two objects from a single table?

    What I decided on for my last problem was to use a method to setBar, and inside that method, set the Foo of the Bar.
    Here are my files for future reference:
    --------------------------------------Foo.java-------------------------------------
    public class Foo {
         public int id;
         public String first;
         public Bar bar;
         public void setBar(Bar newBar){
              if(newBar != null){
                   newBar.foo = this;
              this.bar = newBar;
    --------------------------------------Bar.java-------------------------------------
    public class Bar {
         public Foo foo;
         public String second;
    --------------------------------------Descriptors.java-------------------------------------
    public class Descriptors {
         public static void addDescriptors(Project project) {
    project.addDescriptor(Descriptors.buildFooDescriptor());
    project.addDescriptor(Descriptors.buildBarDescriptor());
    private static Descriptor buildFooDescriptor() {
    Descriptor descriptor = new Descriptor();
    //     basic information
    descriptor.setJavaClass(Foo.class);
    descriptor.addTableName("FOO");
    descriptor.setPrimaryKeyFieldName("ID");
    //     mappings
    DirectToFieldMapping directToFieldMapping;
    AggregateObjectMapping aggregateObjectMapping;
    //     id mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("id");
    directToFieldMapping.setFieldName("ID");
    descriptor.addMapping(directToFieldMapping);
    //     first mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("first");
    directToFieldMapping.setFieldName("FIRST");
    descriptor.addMapping(directToFieldMapping);
    //     bar mapping
    aggregateObjectMapping = new AggregateObjectMapping();
    aggregateObjectMapping.setAttributeName("bar");
    aggregateObjectMapping.setReferenceClass(Bar.class);
    aggregateObjectMapping.setSetMethodName("setBar");
    aggregateObjectMapping.dontAllowNull();
    descriptor.addMapping(aggregateObjectMapping);
    return descriptor;
    private static Descriptor buildBarDescriptor() {
    Descriptor descriptor = new Descriptor();
    // basic information
    descriptor.descriptorIsAggregate();
    descriptor.setJavaClass(Bar.class);
    //     mappings
    DirectToFieldMapping directToFieldMapping;
    //     second mapping
    directToFieldMapping = new DirectToFieldMapping();
    directToFieldMapping.setAttributeName("second");
    directToFieldMapping.setFieldName("SECOND");
    descriptor.addMapping(directToFieldMapping);
    return descriptor;
    ----------------------------------------Go.java------------------------------------
    public class Go {
         public static void main(String[] args) {
              if(args.length != 0){
                   throw new RuntimeException("Arguments are not supported");
              Project project = new Project();
              project.setName("fooBarProject");
              DatabaseLogin login = new DatabaseLogin();
         login.usePlatform(new Oracle9Platform());
         login.setDriverClassName("oracle.jdbc.driver.OracleDriver");
         login.setConnectionString("jdbc:oracle:thin:@nnn.nnn.nnn.nnn:nnnn:SERVICE");
         project.setDatasourceLogin(login);
         Descriptors.addDescriptors(project);
         Server server = project.createServerSession(2, 2);
         server.setLogLevel(oracle.toplink.sessions.SessionLog.FINE);
         server.login("schema", "password");
         Session session = server.acquireClientSession();
         UnitOfWork uow = session.acquireUnitOfWork();
         Foo fooBar = (Foo) uow.newInstance(Foo.class);
         fooBar.id = (int) (Math.random() * 10000);
         fooBar.first = "abcd";
         uow.commit();
         ExpressionBuilder builder = new ExpressionBuilder();
         Foo fooBarLoad = (Foo) session.readObject(Foo.class, builder.get("id").equal(fooBar.id));
         System.out.println("ID:" + fooBarLoad.id + " FIRST:" + fooBarLoad.first + " SECOND:" + fooBarLoad.bar.second );
         session.release();
         server.logout();
    ------------------------------------------------------------------------------------------

  • Concatinating two fields into one..

    Hi all,
    I have a query wherin i need to concatinate two fields and display it into one.
    Query: We have two fields one of subtype 0001 and d other of subtype 0014. I have to display these two fields together.
    The fields are Pernr   Wtf08   ZAllergy   AEDTM    Zlastillness Exdat.
    Where Pernr wtf08 and zallergy Aedtm are in subtype 0001 and the pernr Aedtm Zlastillness Exdat are from the subtype 0014. I took a workarea of the type a method containing all the above fields. And now i want to show all the fields together in one field while displaying.
    Can u please help me with any pointers or any sample code.
    Thanks,
    Anita

    You can create a new Data field with character 255 or more.
    Then you use the CONCATENATE Function to combine all the field you wanted to.
    e.g.
    CONCATENATE Pernr wtf08 and zallergy Aedtm INTO L_display SEPARATED BY SPACE.
    L_display is the field to concatinate two fields.

Maybe you are looking for

  • IPhone 5 bad call voice quality

    Got the new iPhone 5 and have bad phone call quality. The recipient of the call seems to be able to hear me ok, but their voice either isn't there or drops out or sounds grainy like when you have bad cell reception. Many times, the calls have just no

  • Retrieve data from a text file, incrementing the last value and save new value below

    Hi This was working initially. It is part of my LabView Project. I was trying to create a unique number that increments every time the adds the value to the list. It works on computer perfectly. But when I put this on a PDA, it seems to create a blan

  • Help - need Adobe Creative Suite 4 Web Premium Mac OS Installation Disk 2

    Hey there, Hoping someone can help me out on here. I recently moved and purchased a new computer and went to reinstall CS4 only to find that I am missing installation disk 2. As Adobe no longer supports the media for this, they reccomended that I con

  • COMPUTER TO TV VIEWING

    I am new to all this and have purchased a iMac and wish to watch a sporting program I subscribe to on my computer to view on my Sony bravia TV. I have a Time Capsule connected and have no idea how to do this. Someone help pleeeese.

  • SECURITY CODE CHANGED IN NOKIA 5300 XPRESSMUSIC

    Hey everybody, this is my damn NOKIA 5300 XpressMusic and dont know who changed the security code. Now I m getting 1dum tension, please help me. None of the following gets me off the problem: I need a security code to switch off to switch ON/to enter