Ask a Question related to ASP, Design and Development.

  1. #1

    Default forms question

    Hi,
    I have a form with some fields and a submit button. The submit button posts
    the results to itself, which are then processed. I have 2 questions:

    1. Is it possible to have a series of button each of which changes one of
    the items posted and then posts the form?
    2. Is it possible to cause a "processing" banner to be displayed until the
    page gets refreshed?

    Thanks.


    Freeserve Guest

  2. Similar Questions and Discussions

    1. question about forms
      I have run into a few problems when creating an interactive form in acrobat 7 pro. 1. Calculation fields don't seem to add up totals right away....
    2. question about flash forms
      Hi All, Am fairly new to flash and need to re-code a HTML domain name checking form, to a Flash based version. Can anyone help? This is the...
    3. Forms Authentication Question
      Everything is working in my authentication process except for the fact that I can't retrieve the "UserData" property from the...
    4. asp.net FORMS authentication question
      hi all with forms authentication, how does that work for a site with introduction and tour or maybe some more pages? by using forms...
    5. Little question about forms
      I'm making a database at home. I take care of my forms, to fit them on the screen i.e. when the form is maximised, the information on it (lists,...
  3. #2

    Default Re: forms question

    Freeserve wrote:
    > Hi,
    > I have a form with some fields and a submit button. The submit
    > button posts the results to itself, which are then processed. I have
    > 2 questions:
    >
    > 1. Is it possible to have a series of button each of which changes
    > one of the items posted and then posts the form?
    Sure. This is a client-side code question and should have been posted to one
    of the dhtml groups, but, assuming you;ve set the form's id property to
    "myForm":
    1. give your textbox an id (set its id property), say id="txt1"
    2. give the button that controls that textbox a unique id, say id="cmd1"
    3. In a script block, create a cmd1_onclick sub if you are using vbscript,
    or function if jscript. Write the code to set the textbox's value property:
    myForm.txt1.value = "something"
    and call the form's submit method:
    vbscript:
    myForm.submit
    jscript:
    myForm.submit()

    This is your last free pass :-)
    In the future submit client-side code questions to the appopripriate
    newsgroup and indicate which script language you intend to use.
    > 2. Is it possible to cause a "processing" banner to be displayed
    > until the page gets refreshed?
    >
    There is a method which sometimes works, sometimes doesn't. It requires a
    combination of server-side and client-side code:
    Make sure buffering is on and then use response.flush to display your
    message. Then do your processing and hide the message in the window's onload
    event. Here is an example:

    <%@ Language=VBScript %>
    <%
    Response.Buffer=true
    %>
    <%
    if len(Request.Form("text1")) > 0 then
    Response.Write "<div id=""divPrc"">Processing</div>"
    Response.Flush
    dim t
    t=now
    t=dateadd("s",3,t)
    do until now > t
    loop
    else
    //we need the div to be there - this message will never be seen
    Response.Write "<div id=""divPrc"">" & "Nothing to process" & "</div>"
    Response.Flush
    end if
    %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--

    function window_onload() {
    divPrc.style.display="none";
    /*the following line is optional - do not use this if you are submitting
    to another page*/
    MyForm.action=window.location;
    }

    //-->
    </SCRIPT>
    </HEAD>
    <BODY LANGUAGE=javascript onload="return window_onload()">

    <form id="MyForm" method="post">
    Enter some text and click submit:
    <INPUT type="text" id=text1 name=text1>
    <INPUT type="submit" value="Submit" id=submit1 name=submit1>
    </form>

    </BODY>
    </HTML>



    Bob Barrows Guest

  4. #3

    Default Re: forms question

    Correction:
    <%@ Language=VBScript %>
    <%
    Response.Buffer=true
    %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--

    function window_onload() {
    divPrc.style.display="none";
    /*the following line is optional - do not use this if you are submitting
    to another page*/
    MyForm.action=window.location;
    }

    //-->
    </SCRIPT>
    </HEAD>
    <BODY LANGUAGE=javascript onload="return window_onload()">
    <%
    if len(Request.Form("text1")) > 0 then
    Response.Write "<div id=""divPrc"">Processing</div>"
    Response.Flush
    dim t
    t=now
    t=dateadd("s",3,t)
    do until now > t
    loop
    else
    //we need the div to be there - this message will never be seen
    Response.Write "<div id=""divPrc"">" & "Nothing to process" & "</div>"
    Response.Flush
    end if
    %>

    <form id="MyForm" method="post">
    Enter some text and click submit:
    <INPUT type="text" id=text1 name=text1>
    <INPUT type="submit" value="Submit" id=submit1 name=submit1>
    </form>

    </BODY>
    </HTML>




    Bob Barrows Guest

  5. #4

    Default Re: forms question

    Thanks for the info. I will try and get the correct group next time!

    "Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:eXK41NaiDHA.3104@TK2MSFTNGP11.phx.gbl...
    > Correction:
    > <%@ Language=VBScript %>
    > <%
    > Response.Buffer=true
    > %>
    > <HTML>
    > <HEAD>
    > <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    > <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    > <!--
    >
    > function window_onload() {
    > divPrc.style.display="none";
    > /*the following line is optional - do not use this if you are submitting
    > to another page*/
    > MyForm.action=window.location;
    > }
    >
    > //-->
    > </SCRIPT>
    > </HEAD>
    > <BODY LANGUAGE=javascript onload="return window_onload()">
    > <%
    > if len(Request.Form("text1")) > 0 then
    > Response.Write "<div id=""divPrc"">Processing</div>"
    > Response.Flush
    > dim t
    > t=now
    > t=dateadd("s",3,t)
    > do until now > t
    > loop
    > else
    > //we need the div to be there - this message will never be seen
    > Response.Write "<div id=""divPrc"">" & "Nothing to process" & "</div>"
    > Response.Flush
    > end if
    > %>
    >
    > <form id="MyForm" method="post">
    > Enter some text and click submit:
    > <INPUT type="text" id=text1 name=text1>
    > <INPUT type="submit" value="Submit" id=submit1 name=submit1>
    > </form>
    >
    > </BODY>
    > </HTML>
    >
    >
    >
    >

    Freeserve Guest

  6. #5

    Default Forms Question

    I'm creating a multi-page website for different store locations. At each
    location, the customer can access the following common Coupon Request Form:

    mysite.com/coupon.html

    I have a form list with 17 of the store locations. Is it possible to have the
    "Store Location" field's Initial Value change based on the previous page they
    came from? To make this easier for the customer.

    The form is inside the coupon.html page. The LIST element id & name is:
    storelocation. The form's ACTION is set to:

    coupon_rqst.php

    I used a program called "Forms to Go" to create the PHP script.

    Please help. Thanks

    CoolD78 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139