1 form with 2 buttons to go to 2 different pages

Hi. I have 1 form I'm using on a page for adding some information. I have an Add button at the bottom that goes to an action page that inserts the data into an Access Database and displays what was inserted. I want to use the same form, but I want to have another button that goes to a different page, but still inserts the data into the database. How do I do this? Below is what I have for the beginning of the form and the button I click on to add it to the database. I won't put all the stuff inside the form so I keep this concise.
<cfform name="AddECNumber" action="add_new_ec_number_action.cfm" method="post">
<input type="button" value="Add" onclick="verify();">
Andy

jamie61880 wrote:
BKBK,
     Thank you. This works great! I do have one more question though, now. Once the 2nd button is clicked, I would like it to go to an existing page I already have set up. This page is called "add_item_existing_eco.cfm". Normally, to get to this page, the user would have clicked a link to get here. Then this page just adds an item to the ECO.
     But now, I want the page with the form I talked about above to go to this page also, once the form is submitted. So I could add the Inserting code to the "add_item_existing_eco.cfm" page and display the info, but how am I going to prevent the info. from when a link is clicked, to not insert more data.
    I would need an If Statement that says if the "Add new Item Button" was clicked from the Add ECO page, then just insert the data and display the info. Elseif the info. came from a link, then just display the data. How can I say If the "Add new Item Button" was clicked from the Add ECO page? Does this make sense? Or should I just create a new page for when this "Add new Item Button" is clicked?
Yes, the question is clear. There are 2 possible scenarios:
1) From now onwards, an insert will only be done by means of the form button. Coming to the action page by means of a link will no longer lead to an insert.
Form page:
<script type="text/javascript">
function verify()
   document.myform.action ="add_new_ec_number_action.cfm";
   document.myform.submit();
function sendIt()
   document.myform.action ="add_item_existing_eco.cfm";
   document.myform.submit();
</script>
<cfform name="myform" method="post">
<cfinput type="text" name="txt"><br>
<cfinput type="button" name="submitBtn" onclick="verify()" value="Add"><br>
<cfinput type="button" name="submitBtn" onclick="sendIt()" value="Insert">
<cfinput type="hidden" name="isUpdated" value="yes">
</cfform>
Page add_item_existing_eco.cfm:
<cfif isDefined("form.isUpdated") and form.isUpdated>
<!--- Insert the data --->       
</cfif>
<!--- Display the info --->
2) An insert can be triggered by the link or by the form-button, which ever arrived first at the page dd_item_existing_eco.cfm.
I do believe the best solution in this scenario is to use the database. Start, for example, by determining which column in the database table can be used to verify that an insert has occurred. A datetime column is ideal for this purpose.
Then add a query, like the following, to verify whether an insert has already occurred in a specific time.
<!--- Number of inserts done in the past 6 hours (Assumption: doneDate registers datetime of each insert) --->
<cfquery name="verifyInsert" datasource="myDSN">
    select count(*) as numberOfInserts
    from myTBL
    where doneDate > #createODBCDatetime(dateAdd("h",-6,now()))#
</cfquery>
<cfif verifyInsert.numberOfInserts EQ 0><!--- No insert has yet occurred --->
<!--- Code to do insert --->
</cfif>
<!--- In all cases, display info --->

Similar Messages

  • I want to build a form with radio buttons to limited clients ticking every option.

    I want to build a form with radio buttons to limited clients ticking every option. I have a range of products and in order to quote accurately I want to get specific information.

    If I get this , you want to show form options to specific clients not to all site viewers ?
    You would need to create a secure zone for this where permitted viewers can login and view the form with all options , in form itself we cannot setup this as few customers will view other options and others will view a different one.
    This can be done from your hosting end. Or if you are using Adobe server for hosting then you can create some profiles for customers and then setup a separate form altogether to achieve this.
    Thanks,
    Sanjit

  • I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Cent

    I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Central in order to use this feature. What gives? The Adobe site gave me the impression that I would have this feature after purchasing the new upgrade. I would not have purchased the upgrade, let alone five of them had I know this. Am I missing something?

    Acrobat XI comes with the Fromscentral AIR application and the ability to create PDF forms authored in Formscentral. To have more than the free (1 form with 50 responses) level account you need to sign up for a Formscentral subscription.
    Andrew

  • How can I create a form with a button that adds a new page of fields to fill out?

    Hi,
    I have a one-page form created in Acrobat Pro 9 that contains five fields for a user to complete. I'd like to give the user the option of adding a page with the same five fields to fill out. The user finishes those fields, presses an "Add a Page" button, and then gets another page to fill out, and so on. When finished, their PDF form might be 10 pages long, at which point the user can save it as a single PDF file. Is this possible to do in Acrobat Pro 9 or 10, and if so, how?
    Thanks,
    Andrew

    When I created a new template like you told me, I wasn't given the option to rename the fields. See screenshot below. I'm just given the option to add a new template. Changing it refers to changing the template to a different page.
    If you can show me how to have the fields renamed automatically or use the rename parameter, I think that should fix it.
    Under Tools>JavaScript>Document JavaScripts, I've added a Script named "PackagingArtwork".
    // Here is the code
    function PackagingArtwork()
    {this.createTemplate({cName: "PackagingArtwork", nPage: 5});
    // Here the code that spawns the template
    var PackagingArtworkArray = this.templates;
              var PackagingArtwork = PackagingArtworkArray[0];
              PackagingArtwork.spawn(this.numPages, false, false);
    This is what the JS debugger said.
    Acrobat EScript Built-in Functions Version 10.0
    Acrobat SOAP 10.0
    var t1 = createTemplate("t1", 0);
    var oXO = t1.spawn({nPage: numPages, bOverlay: false});
    while (numPages < 50) {
        t1.spawn({nPage: numPages,  bOverlay: false, oXObject: oXO});
    undefined
    [object CosObj=<<Stream>>]
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:Field:Mouse Up
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1
    TypeError: PackagingArtworkArray is null
    2:AcroForm:Duplicate Packaging Artwork:Annot1:MouseUp:Action1

  • Acrobat form with submit button

    Have a coldfusion app that includes an acrobat form that contains a submit button.  The button submits the form to another CF page.  I'm making some fixes to this app and need to change where the form submits, currently it's going to production but i need it to go to test.  When I open the form in Acrobat 8 or Livecycle I don't see any script.  Anyone know where to change wheer this form posts?

    Not sure about LiveCycle, but here's how to do it in acrobat.
    1) Right click on Form Button -> Properties -> Actions
    You should see a list of actions associated with the button.  something like:
    - Mouse Up
           Submit a Form
    2) Select on "Submit a Form" and click "Edit" at the bottom of the screen
    3) Edit URL in "Submit Form Selections" window.

  • Form with Submit Button

    I recently purchased the acrobat professional 8 and tried to create forms that people can fill in and submit it to us. I tried email button but for some reason never get the email for the data. I thought about http button, but it need some scripting skill. I have some knowledge in ASP script but never create any script for form submission before. Can anyone show me some sample of how to create the script or point me to the right direction that I could have the submit button feature?
    Also, I seem some forms that can allow reader users to save the data that they type in the form onto their computer, do anyone know how to create a form with this feature?
    Thanks

    Use a regular button and change it's control type to submit. Under the Submit tab type in "mailto:youremailaddress". You can then either choose the Submit As for XML, which will send you the data that you can then import into the form or choose Submit As for PDF and you'll get the entire document.
    Also, open the form in Acrobat, go to Advanced > Enable Usage Rights in Adobe Reader. This will solve your problem.
    *one thing to note, if you ever make changes to your form be sure to do the Enable Usage Rights in Adobe Reader step again.

  • Fillable forms with radio buttons (Using Adobe Reader X)

    I have two questions: First question, I have a fillable form with "yes" and "no" radio buttons. Currently the radio defaults to answer "yes", but I would like both the "yes" and "no" fields to be empty, which would allow the user to select an answer on his or her own.  Second question, is there a way to make an answer required before moving on to the next question?
    (Using Adobe Reader X)
    Message was edited by: mp2athome

    You need to check and make sure that the options  for each radio button do not have the "Button is checked by default" selected.
    You can make all the following answer radio buttons "read only" and only after one of the choices for the preceding question has been answered are the radio buttons for the next question are write enabled.
    You will need Acrobat to create the form.

  • How to design a form with multiple lang(Arabic and Eng) in a page

    Hi All,
    Could you pls help me how to design a form with multiple languages. when I set the form proprties-->Form Locale as Arabic. English text is comming in reverse and when set the FormLocale as English, Arabic text is comming in revese.
    Pls help me how to design
    Thanks in advance.
    Regards,
    Jayakar

    I am not sure how you can have two different languages inside the same PDF.
    Alternatively, if you want to place only the static labels, you can convert all the static label in one language to images and set the form language setting to other. And place the images inside the form using Image field. For example, you can keep the form language as English and then convert all the arabic language labels/ Static text to images.
    Anotherway,
         Have same sections in both the languages and hide and unhide based on the user selection of the language..
         if your user chooses Arabic, then you can unhide the Arabic sections and change the form language properties programmatically..
    Thanks
    Srini

  • Error on Form with a WebBrowser control: A script on this page causing your web browser to run slowly.

    Hi,
    I have a form with a WebBrowser control. When I load a page, I am getting the following error popup:
    Stop running this script?
    A script on this page is causing your web browser to run slowly.
    If it continues to run, your computer might become unresponsive.
    How to suppress the above error? I tried using WebBrowser.ScriptErrorsSuppressed by setting it to true. But it didn't work for me.
    Thanks in advance.
    Thanks Prasad

    Hi,
    I have a form with a WebBrowser control. When I load a page, I am getting the following error popup:
    Stop running this script?
    A script on this page is causing your web browser to run slowly.
    If it continues to run, your computer might become unresponsive.
    How to suppress the above error? I tried using WebBrowser.ScriptErrorsSuppressed by setting it to true. But it didn't work for me.
    Thanks in advance.
    Thanks Prasad
    Hello,
    In addition, would you mind sharing us the version of your IE and the detailed html code of that page?
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to save a pdf form with a button on Android?

    Hello can anyone inform me with the knowledge of how to save a pdf form after filling with button on an Android device?
    What code behind the button is necessary to make this work.

    It happens automatically. You don't need any code to trigger it.

  • Creating a form with radio buttons that users can fill, save, and e-mail back

    Hi all,
    I am new here, so please forgive me if this answer has already been answered. I have been looking around and still have not been able to find an answer.
    I have created a pdf in InDesign and opened it in Acrobat to create a form out of that existing PDF. The form needs to contain radio buttons and text fields. When I save it to test it out on Adobe Reader (for the typical user), it says that I am only allowed to save it in its original form (without any of the changes) thereby making this form useless (I do not want users to print it out; I'd like them to email the entire PDF back to me).
    I've looked online and found some answers saying that I would just need to enable commenting, but when I tried that, I could no longer select any of the radio buttons in Adobe Reader.
    Any suggestions?
    Thanks in advance.
    I'm on a Mac using Adobe Acrobat 7 Professional.

    You won't see that in 7. It didn't exist until Acrobat 8. Though It would work with PDF's opened by Reader 7.
    The only choice you have is connacting someone at Adob coporate and finding out how to sign up to a Service they have that will llow you to do that.
    Caution: its very, very expensive and unless  your fortune 1000 company you can't afford it.
    OR you could upgrade to Acrobat 10 (if you have a Machine capable of running it - Intel Only) or Acrobat 9 (PPC and INTEL).
    Note the feature they speak of only allows for 500 instances of any one PDF set up to do so.

  • Submiting multiple forms with one button

    I have a form that has a cfform within it. The cfform has a
    cfloop in it that includes an id and a dropdown list box that
    includes a new id. I want to transfer one id to another. I want the
    user to be able to click on one button that would update all the
    rows in the table with the new id.
    If there are 3 rows in the query, the user would select an
    entry in a dropdown for each row and upon clicking on the submit
    button all three rows would be updated with the id selected from
    the dropdown.
    Any suggestions?
    Thanks for the help!
    Gary

    There isn't a way to set this up using the Paypal payment integrated into FormsCentral using seperate forms for each child, you can set up one form so they can register additional children and then pay in one session, but if you need each child to be a unique form submission it can not be set up to pay for multiple at once.
    Thanks,
    Josh

  • PDF submit form with denial button trouble

    Hello all. I have researched a ton and found out how to have a submit button, via the fake email button, reading a field and incorporating that in the subject line. The next thing I need to do is to have a denial button that creates a new email and sends it to an email address input on the form from the user with the subject line reading "Denied Turn in Request" and the pdf attached. I thought that it would the same as the submit button but I can't get it to work at all.
    The flow of the pdf document is:
    User has document on their computer
    Fill it out and click submit button
    Emailed to my office
    If denial is needed click denial button
    pdf document is emailed to the email address on the form
    wash, rinse, repeat.
    Any help is appreciated. My network will not allow me to upload the document at work. I will once I get home.

    If you are using the fake submit button approach you shoudl be able to modify the email parameters (through script) when the user
    hits the denial button and then hit the email button programmatically of course. This is no different than what you are already doing.
    Paul

  • Single Form with a button for two seperate form versions.

    Is it possible to create an option to select between two seperate Form Versions. For example. I have a Transfer Form. But there is an internation version and a domestic version. Both have some simple javascript.  I would like to combine these two forms into one document. When the end user opens the form, i would like to have a button for either domestic or internation. Depending on what the end user selects, it loads that version of the form. I have played around for a while and havent gotten anywhere, and i would like to know if there is even a way to acomplish this, or does it have to be two seperate document forms completely?

    With Acrobat or Reader XI one can show or hide a template page. You need Acrobat to create a template page.
    If your users will be using older versions of Reader, then you would need to hide or unhide form fields.

  • Cannot open form with a button

    Hi folks, I'm new to Developer, so apologies.
    I am opening a form xxx by attaching a smart trigger of WHEN-BUTTON-PRESSED to a button by
    call_form('xxx');
    It compiles fine, but when I evesute the form, it says errer 400010 cannot read form. Any ideas?
    Thx,
    Ken

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Carter:
    Put the called form's fmx file in a directory specified in the FORMS60_PATH key in the registry
    <HR></BLOCKQUOTE>
    More simply, you can pass the parameter with the path. ie call_form('c:\xxx.fmx') and so.
    If you want to pass any other parameters check it in the help for call_form. Tip. You also can use run_form/new_form to call a new form and go_form to navigate b/w forms.

Maybe you are looking for

  • All new files and folders show up as READ ONLY

    I am new to the iMac, and am having problems with files an folders. My account is an administrator's account, but when ever I create a new folder, or move a file into it, it shows up as READ ONLY. This is really annoying as I am moving hundreds of fi

  • Imported clips not showing up in Event

    I have version 10.0.5 and imported video clips from my iPhone.  The file size shows 9.5GB yet no clips are showing up.  They were in the Event prior to my quitting iMovie but when I reopened it shows Empty.  Help?

  • Using server time in  Timer Class

    Hai, I have develped an application(stand alone) using swings. the exe runs in all the systems in my company. requirement is --> application has to be closed at 11.59 P.M everyday. i did this task using Timer class. Timer class takes the system time

  • HT201406 when ipod is switched on the screen shows a usb cable symbol and itunes symbol, why is this

    when ipod is switched on the screen shows a usb cable symbol and itunes symbol, and it wont let me switch it on even though it is fully charged up, why is this?

  • Authorization issue with the HCM forms

    Hi, Initiating Manager is able to initiate the form but it does not proceed to the next approval step because of some missing authorization. Currently we are able to carry out our tests because SAP_ALL has been assigned to the users involved in the p