ASP form

Posted on 2006-04-21
Last Modified: 2010-04-06
I have a form with three fields (2 pulldowns, and 1 checkboxes) if a certain criteria is met
I would like to introduce another field. Do I do this at the submit?

ie. If Field A = 123 and Field B = XYZ then post to newpage.asp


post to emailformpage.asp
Question by:tmurray22
    1 Comment
    LVL 9

    Accepted Solution

    Like this: (use a JS function that will change the action of your form in a certain condition upon submit)

    <form action=emailformpage.asp onsubmit="return checkValues(this)">
    <input type=text name=fieldA>
    <input type=text name=fieldB>
    <input type=submit>

    function checkValues(frm)
    if ((frm.elements["fieldA"].value=="123")&&(frm.elements["fieldB"].value=="XYZ")) frm.action="newpage.asp";
    return true;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now