Multiple buttons for same action page

I have a cfform with an action page.
I have two buttons at the bottom with different labels, like
button 1 and button 2, that call this action page to insert data.
After the insert, the page needs to be redirected page 1 if button
1 was selected, and redirected to page 2 if button 2 was selected.
How can I separate the two so that they go to different forms
I tried passing a variable in the cfform action, but it
applies to both buttons, thus both go to the same place, and I
cannot seem to separate.

trojnfn wrote:
> <script language="javascript">
>
> function validateForm(pack_slip_form){
>
> var returnStatus = true;
>
>
> if (pack_slip_form.supplier_name.value == ""){
> alert("Please Enter The Supplier Name");
> pack_slip_form.supplier_name.focus();
> returnStatus(false);
> }
>
>
> if (returnStatus){
> pack_slip_form.submit();
> }
>
> returnStatus(true);
> }
>
as far as i can see, returnStatus is not a function, so what
is
returnStatus(true) ???
change that line instead to
else {return false;
> This is my form tag, from the other example :
> <cfform action="pack_slip_action.cfm method="post"
name="pack_slip_form"
> onSubmit="return ValidateForm()">
>
> And here are my two buttons below :
>
> <input type="submit" name="button_1" value="SAVE AND
ADD PACK SLIP"
> onClick="validateForm(document.pack_slip_form)">
>
> <input type="submit" name="button_2" value="ASSIGN TO
PROCUREMENT"
> onClick="validateForm(document.pack_slip_form)">
>
>
you only need to call your validateForm function either from
the <from>
tag OR your submit buttons, not both.
and the function call in the form tag is incorrect - a) the
function
name is spelt wrong and b) it does not pass required argument
to the
function. change that to onSubmit="return
validateForm(document.pack_slip_form)" and remove the onCLick
events
from your buttons
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Similar Messages

  • Multiple buttons for a given validation

    I want the same validation to be done on the click of two buttons. In the "Conditional Validation Processing", I see we can
    "select a button" which allows us to select only one button.
    How can I select multiple buttons for a given validation?
    Is there a way or do I need to create another validation for the second button.
    Please advice.

    When you submit a page with a button the "request" value is set to the button name (not the displayed button label). After-submit events can check the request using :REQUEST or v('REQUEST') so you can build a condition like:   :REQUEST in ('APPLY','CREATE')..or you can use a built-in condition type that checks the request value like 'Request is Contained within Expression 1'.
    Scott

  • Reg:Multiple UOMs for same item

    Hi,
    How to define the multiple UOMs for same item.And the item should be converted in one UOM.
    Iam using 9.0 PL.08

    Hi,
    Please check SAP help file:
    http://help.sap.com/saphelp_sbo900/helpdata/en/89/7ca0a701c64e4a97f4ea5a4edca8b2/content.htm?frameset=/en/44/c4c1cd7ca22e17e10000000a114a6b/frameset.htm
    Thanks & Regards,
    Nagarajan

  • How to avoid multiple listing for same artist?

    How to avoid multiple listing for same artist?

    Sounds like there might be blanks in the artist name.
    For instance "Lou Reed" and "Lou Reed_" will not match.
    (Pretend the underscore _ is a blank).
    Select all the Lou Reed songs, Get Info, and type "Lou Reed" in the artist field. That should fix it.

  • Creating multiple profiles, using unified profile types, to store multiple values for same properties

    Hi All:
    I am trying to create multiple profiles, using unified profile types, to
    store multiple values for same properties. Here my intention of using
    'unified profile types' is to create multiple profiles (to store multiple
    values for a property). All the properties are stored in the same database
    maintained by Personalization server. Also, I am trying to use the same
    'USER' ejb as profile class/home/pk/jndi.
    The scenerio is,
    define unified profile types (Business, Vacation) using Personalization
    admin tools, using com.beasys.commerce.axiom.contact.User,
    com.beasys.commerce.axiom.contact.UserHome,
    com.beasys.commerce.axiom.contact.UserPk,
    com.beasys.commerce.axiom.contact.User for Profile Class, Home, Pk class,
    JNDI name respectively.
    Define Property set 'HotelCommerce' with property
    HotelProp as single, restricted, text (valid values Single, Double)
    Now you can use the attached jsp files to login as a user and try to set the
    property value for HotelProp for each profile. As per my understanding, I
    was expecting that I can set different values for the property 'HotelProp'
    for each profiles. But unexpectedly, all the profiles get the same value.
    Question. is it the correct behavior? if yes, how can I achieve this
    functionality?
    if not, do you see any problem in my scripts?
    your answer asap is appreciated. we need to make decision on using
    Personalization server v/s developing our own Personalization server!!!:)
    thanks,
    -rajesh
    PS: I have tried 'Unified Profile Example' type too, but that did not work.
    [propsettest.jsp]
    [home.jsp]

    I am trying to create multiple profiles, using unified profile types, to
    store multiple values for same properties. Here my intention of using
    'unified profile types' is to create multiple profiles (to store multiple
    values for a property). All the properties are stored in the same database
    maintained by Personalization server. Also, I am trying to use the same
    'USER' ejb as profile class/home/pk/jndi.Hello Rajesh,
    This is not the purpose of the UUP. The UUP is used to allow existing
    database schemas to be aggregated with the existing Weblogic Personalization
    Server database schema to provide a single, customized user profile with which
    to maintain the user properties (
    http://e-docs.bea.com/wlcs/p13n/users.htm#1068901 )
    If you want to have properties that change value based on some "profile" or
    classification of a user, then you should use classifier rules to change the
    user from "OnVacation" to "AtWork" or "AtHome". You can use these classifier
    rules to select content for the user or conditionally execute logic (
    http://e-docs.bea.com/wlcs/p13n/rules.htm )
    Ture Hoefner
    BEA Systems, Inc.
    1655 Walnut Street; suite 200
    Boulder, CO 80302
    www.beasys.com

  • Where did the "Stop" button go on the Navigation Bar in ff4? It isn't included in the Customize box. Is there anyway to install the "Stop" button for loading web pages or is this option compeletly gone from Firefox now?

    Just installed upgrade to Firefox 4.0. Where did the "Stop" button go on the Navigation Bar. I checked the Customize dialogue box and it isn't included. Is anyone else missing it? Is there anyway to install the "Stop" button for loading web pages or is this option completely gone from Firefox now? It was a very helpful button and allowed us users to stop a web page and move on if it wasn't what we needed.

    In Firefox 4 by default the Stop, Go and Reload buttons are combined and attached to the right hand edge of the location bar.
    When you are typing in the location bar it will show the Go button. When a site is loading it shows the Stop button. At other times it shows the Reload button.
    If you want separate buttons, right-click on a toolbar and choose Customize, you can then drag and drop the stop or reload buttons and place them elsewhere. If you place them in the order "Reload-Stop" on the right hand edge of the location bar they will be combined again. For more details on customizing the toolbar see https://support.mozilla.com/kb/How+to+customize+the+toolbar

  • Creating buttons for a search page

    I have a site that has over 3K records that are searchable.
    I need to create a new method of the drop down list using buttons, as drop down lists do not work well on a telephone.
    The site is http://www.tyneships.co.uk, so if you have a look there you will see my problem.
    So I thought that if I narrowed the options down to a set of buttons, each with a single letter on it, I could create an on the fly page for each letter that exists, as the contents change regularly.
    I have a recordset, and have written code that reads it in and prints out each available first letter of all possible search items. I need to then create a button using php that holds this letter.
    In html, the following code would be used:
    <input  type="text" name="button" value="A" />
    I have the value of "A" in a variable called $b, which is not a post variable
    How do I get $b to appear in place of the "A".
    I do not know if it is a syntax error problem or what, but I would have thought that there should be a way to do it.
    I have investigated the newt_button(x,y,"button_name") function, which is supposed to create a new button at location x,y  but it does not seem to exist in my version of Xammp php (5.3.1).
    Can anyone help?
    Dreamweaver 5.5 on win 7 OS

    One of the drop downs is at http://tyneships.co.uk/phpfiles/findall.php5 which lists all the 3K+ records. All others appear on the Search menu item on the left of most pages other than the splash page.
    I find these very dificult to use on a mobile, without having to zoom in.
    It occurred to me that creating a set of buttons would be very helpful to users, as the whole set can be filtered using the same numberof pages that are needed using a drop down list.
    The grid below is a result of a quick search of all records listing the first letters of all types in the data, and displaying them as buttons.
    Notice that I, J, Q, X and Z do not appear in the grid, as there are no types in the database beginning with these letters.
    As a result, a click on any of these buttons should produce valid data. No error checking is yet in place.
    Above is my first attempt to create the buttons on a grid using php. Ignore the uU buttons - garbage in the data file now sorted on line.
    The working source code is shown below, without the data file access code or css. The original code that I used suffered from logic errors and syntax errors, now fixed.
    <body>
    <form action="get_types.php" method="get" name="type_form" target="_self">
    <table border="1" cellpadding="2" cellspacing="2" class="purple">
    <?php
    $rowcount = 1;
    do {
    $b= ($row_Recordset1['type']); // Read the record
    $b = left("$b",1); //get its first character
      if ($old <> $b) { // then we have found a new letter so print it as a button
    echo '<td> <input type="button" name="button" value="' . $b . '" </td> ' ;
    if ($rowcount <=6) { // count the columns in the row. If less than 6 add 1
              $rowcount++;
    $old = $b; //reset the old character to the new one
    if ($rowcount == 6) {// if its 6, we are at the end of the row
               echo '<tr>';  // end the row
               $rowcount = 1;//reset it to 1
      ?>
       <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
      </table>
    </form>
    <span>
    Click the 1st letter of the type group</span>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>
    This code generates the buttons in a grid at the correct size for a,320x300 phone.
    Now I have the buttons set up, I need to get them to do something - like submit the form.
    This needs a bit more thought, as usually you only have one button doing the sending.
    I suppose I could place a form round every button, but there must be a better way. All suggestions welcomed.
    Once this problem is overcome, the button clicked on should send its letter to the next page, which would display a list of all types beginning with the chosen letter, and clicking on these then links to a sliding photo display of all the ships in the type group.Easier to use than a drop down list, but the logic and coding from scratch is more difficult.
    Howard Walker

  • Multiple Rows for Same Value in Matrix Report

    Hello
    I am trying to create a matrix report that shows different page for each Category. Report looks like follows:
    Page1( for Category '1')
    Agent |
    Calls |
    Sales
    TestAgent1 18
    3
    TestAgent1 5
    1
    Page2( for Category '2')
    Agent |
    Calls |
    Sales
    TestAgent1 26
    5
    TestAgent1 13
    2
    The issue is as you can see in above table, that i am getting repeated rows for same agents. I have tried making a parent group on Agent but it would still keep showing multiple rows. Ideally, it should show each agent only once in each page.
    Any help would be appreciated.
    PS: I am new to SSRS and this is my first time on microsoft blog, so i apologize if i wasn't able to follow the protocols/culture here.
    Thanks

    Hi M Adnan,
    According to your description, you want to show a total Calls and total Sales for same agent so that it has only one row for each agent in your category group. Right?
    In this scenario, if you only have a row group for category, it will show all “detail rows” in this groups even the agent of these rows are same one. So we can add a row group, set those detail rows group by agent and use Sum function to get the total Calls
    and Sales. It looks like below:
    If we want to display each Page in horizontal, we just need one Category column group for grouping rows and use sum function to get total Calls and Sales for each agent. It looks like below:
    Reference:
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

  • Syncing ical creates multiple entries for same event

    I'm sure this is common. I cal sync creates multiple enties for the same event. Any way to work around this?
    Also, duplicate calendars are on the Iphone (2 for inbox)  can one be deleted? 

    I think I know what can help. I also support Mac users in a mixed environment, and find that being able to access a Windows machine to test settings for my iCal users is very very helpful. If you do not have one, I could also fix this one by adding the user's account to my one Mac that runs Entourage.
    On a PC: set up one of the problem accounts in Outlook, then go to Tools->Options & click on the Delegates tab. Click on a Delegate name (if they all have the same permission level, you can select all), then click the Permissions button. If the delegate have "Editor" permissions, there will be a little checked box that sends the delegate copies of all those meetings. De-select it.
    Lemme know if you want Entourage instructions or if that does it for you.
    The real question, of course, is why are there so many Exchange functions that iCal can't touch. Grrrr....

  • How can I combine multiple listings for same genre on iTunes 11?

    When I downloaded the newest iTunes version 11, I suddenly had multiple listings for the same genre. I literally have 63 genre listings for "Trance"; 4 listings for "Hip-Hop/Rap" and a few others. There was obviously not a problem with the old iTunes version as they were all grouped together. I do get music from several sources but I have no idea how to combine all my "Trance" listings into one. It takes longer to scroll through the "Trance" genres than the rest of my genres combined. I tried to individually change one the "Hip-Hop/Rap" listings by using the "Get Info" tab and typing in the genre until iTunes can autofill the rest but the problem remains. Any ideas how to combine all these into one genre without compromising the genre name? Thanks
    Mac OS X Version 10.6.8 Snow Leopard

    I believe the closest you can come is look at your songs in Songs.  There you can sort by albums.
    The album view does not contain a list view any longer.

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Multiple entries for same apps showing next to 'Open With' in contextual menu since last backup

    I did a back up of my MBPs internal drive recently, using Carbon Copy Cloner - since then there are multiples of the same icons for all apps under 'Open With' in the contextual menu. I seem to remember there being a command line that could be entered in Terminal to fix this, but I can't find it anywhere.
    Can anyone help?

    Yes, LaunchServices. These are only cache files but can get corrupted. Launch /Utilities/Terminal and copy & paste this at the command line to rebuild LaunchServices: (be sure to copy the entire line it's a scroll)
    Code:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    Then press return. Wait until terminal returns to the command line. Quit Terminal. After that, log out and back in or restart. Let us know

  • ME01 LSMW multiple record for same material issue.

    Hi Experts,
    I have an issue with multiple record for the same material and plant when I upload the data from the file.  Lets I have the records.
    Material        Plant              Start date      Enddate        Vendor          Porg.
    1     0010     20060101     99991231     2     0010
    1     0010     20060101     99991231     3     0010
    When I upload the above data there are 2 IDOCs created when I am using the method LSMW-IDOC method, but only last record is getting updated and the first one is not getting updated in ME01 souce list. But I am getting the success message for both IDOC in LSMW. So I am not sure how to fix this why only last record is updated and not other records??

    why do you have 2 idocs?
    wouldn't be 1 idoc with 2 items be more logical?
    1 record in structure E1EORDH
    and 2 records in structure E1EORDM
    I believe your 2 IDOCs get posted, but I think your 2nd Idoc overwrites the values entered from the first IDOC.

  • Skip lot across multiple batches for same material

    Hi,
    I am looking for a way to control skip lots across multiple batches for the same material.
    We need to do a quality check in production after a certain quantity produced (on a machine, for a material). My idea was to do skip lots (for GR)  until we reach a threshold (say 10.000 pcs) and then do an inspection for the next GR for that material.
    Any ideas how to set that up?
    Thanks for any hint
    Andreas

    Hi mergler,
    Ref to your query pls check this link Stock Posting for Skip Lots
    Thanks in advance

  • Multiple entries for same title in ADE title list

    I have 6 entries for the same title in the ADE title list.  All have the same date and time added.  All but one are blank in the "Last Read" column.  On my computer I have only 1 epub file for this title.  Why do I have multiple entries for the same title?  If I delete all entries except for the one that has a date and time in the Last Read column will that be okay -- will I still be able to access the book?

    Hi
    This is the normal effect of SAP DBSL SQL code translation.
    You can find a lot of post on SCN that will help you to understand this behavior...
    Regards
    About rsdb/prefer_join and rsdb_prefer_union_all
    634263 - Selects with FOR ALL ENTRIES

Maybe you are looking for