Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Submit Button

    I have a web form with a few text fields some validataion and a submit
    button.

    When I click the submit bittin the serverside event does not fire?????
    Why!!!! I have tried Changing the EnableViewState I have tried removing
    CausesValidataion.
    I am using VisualStudio 2003/.net 1.1

    <asp:Button id="submit" runat="server" Text="Update" EnableViewState="True"
    CausesValidation="true"></asp:Button>


    private void InitializeComponent()
    {
    this.submit.Click += new System.EventHandler(this.submit_Click);
    this.Load += new System.EventHandler(this.Page_Load);
    }
    #endregion
    private void submit_Click(object sender, System.EventArgs e)
    {
    Response.Write("This is the button clicked");
    // Update the users file here
    userRec.Replace(txtName.Text,14,0,0);
    userRec.Replace(txtEmail.Text,13,0,0);
    userRec.Replace(txtFax.Text,21,0,0);
    userRec.Replace(txtVoice.Text,19,0,0);
    tblEUsers.Write(userId,userRec);
    if (txtPass.Text != "") // save the password
    {
    }
    }

    Kevin Bilbee


    Kevin Bilbee Guest

  2. Similar Questions and Discussions

    1. Submit button style
      Hi, I am trying to change the style of a submit button ('<input type="submit" value="Update">') using stylesheets but everytime I use something...
    2. [PHP] using submit button and PHP-HELP
      thanx for your help, Ive got flu and all these small things seem to be escaping my eyes. I just want to ask you a small question: If i want this...
    3. using submit button and PHP-HELP
      Hi, I have a form that has a submit button in it, when the button is pressed I want it to reload the same page, with the same URL, however when I...
    4. value submit button
      You can get the button value use code below: <?php echo $_POST;?> <form method="post"> <input type="submit" name="submit" value="submit1">...
    5. Help with Submit button...
      Hi, I have a graphic, I wanted to use it for a submit button. For some reason it does not work.. it acts more of a link. The problem with...
  3. #2

    Default Re: Submit Button

    the property Page.IsValid is what fires the validation event. you must
    check in you page somewhere.





    "Kevin Bilbee" <kbilbee@standardabrasives.com> wrote in message
    news:O$p#onySDHA.2148@TK2MSFTNGP12.phx.gbl...
    > I have a web form with a few text fields some validataion and a submit
    > button.
    >
    > When I click the submit bittin the serverside event does not fire?????
    > Why!!!! I have tried Changing the EnableViewState I have tried removing
    > CausesValidataion.
    > I am using VisualStudio 2003/.net 1.1
    >
    > <asp:Button id="submit" runat="server" Text="Update"
    EnableViewState="True"
    > CausesValidation="true"></asp:Button>
    >
    >
    > private void InitializeComponent()
    > {
    > this.submit.Click += new System.EventHandler(this.submit_Click);
    > this.Load += new System.EventHandler(this.Page_Load);
    > }
    > #endregion
    > private void submit_Click(object sender, System.EventArgs e)
    > {
    > Response.Write("This is the button clicked");
    > // Update the users file here
    > userRec.Replace(txtName.Text,14,0,0);
    > userRec.Replace(txtEmail.Text,13,0,0);
    > userRec.Replace(txtFax.Text,21,0,0);
    > userRec.Replace(txtVoice.Text,19,0,0);
    > tblEUsers.Write(userId,userRec);
    > if (txtPass.Text != "") // save the password
    > {
    > }
    > }
    >
    > Kevin Bilbee
    >
    >

    bruce barker Guest

  4. #3

    Default Submit Button

    Using Dreamweaver MX.

    I may be being rather stupid, but where and how do I apply an E-Mail Address to a Submit Button.

    I have a number of Submit Buttons on Forms - all of which I want sent to an E-Mail Address.

    I am lost as to where to indicate the destination e-mail Address


    AlanW99 webforumsuser@macromedia.com Guest

  5. #4

    Default Re: Submit Button

    Try adding a "mailto" action. I would recommend using a server-side
    script, however. This may help more:

    How to get data from a form into an e-mail
    [url]http://www.macromedia.com/support/dreamweaver/ts/documents/form_email.htm[/url]

    -- Mike


    "AlanW99" [email]webforumsuser@macromedia.com[/email] wrote:
    > Using Dreamweaver MX.
    >
    > I may be being rather stupid, but where and how do I apply an E-Mail
    > Address to a Submit Button.
    >
    > I have a number of Submit Buttons on Forms - all of which I want sent
    > to an E-Mail Address.
    >
    > I am lost as to where to indicate the destination e-mail Address
    >
    >
    >
    MLangner-MMTS Guest

  6. #5

    Default Submit button

    I am trying to right a script so that the "submit button" only appears when
    certain criteria has been met. I have tried putting it in an IF statement,
    without any luck. Maybe a function would allow me to do this?

    <input type="Submit" value="Update">

    Any help would be greatly appreciated

    TIA

    Jim



    Jimbo Guest

  7. #6

    Default Submit Button

    I am trying to right a script so that the "submit button" only appears when
    certain criteria has been met. I have tried putting it in an IF statement,
    without any luck. Maybe a function would allow me to do this?

    <input type="Submit" value="Update">

    Any help would be greatly appreciated

    TIA

    Jim






    Jimbo Guest

  8. #7

    Default Re: Submit Button

    Jimbo <Jim@garner21.freeserve.co.uk> wrote:
    > I am trying to right a script so that the "submit button" only appears when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    <?php
    // this way no button
    if(criteria) echo "<input type=\"Submit\" value=\"Update\">";
    ?>

    <?php
    // this way grey button
    if(criteria) $xtra="disabled";
    echo "<input type=\"Submit\" {$xtra} value=\"Update\">";
    ?>

    > Any help would be greatly appreciated
    > TIA
    > Jim
    There is a disable parameter for I think 'input'
    that would grey the button rather than it not
    be there. A clear indication in UI terms of
    incompletion.
    Does that sound like what you want?
    Otherwise don't output that part of the form and
    it won't appear at all.
    (ie the input line you show above as I have mod it)
    That's not nice though :)

    Hope this helps you.
    -Walt

    --
    Reply to innkeepATcapitalDOTnet to email questions.


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    [url]http://www.newsfeeds.com[/url] - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    PenguinsAnonymous Guest

  9. #8

    Default Re: Submit Button

    Jimbo wrote:
    > I am trying to right a script so that the "submit button" only appears when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    >
    ><input type="Submit" value="Update">
    >
    > Any help would be greatly appreciated
    Why didn't the IF work?
    What was the error (if it was an error)?

    <?php
    // ...
    if ($ok_to_output_the_submit_button) {
    echo '<input type="submit" value="Update"/>';
    }
    // ...
    ?>

    --
    ..sig
    Pedro Graca Guest

  10. #9

    Default Re: Submit Button

    Pedro Graca <hexkid@hotpop.com> wrote:
    > Jimbo wrote:
    >> I am trying to right a script so that the "submit button" only appears when
    >> certain criteria has been met. I have tried putting it in an IF statement,
    >> without any luck. Maybe a function would allow me to do this?
    >>
    >><input type="Submit" value="Update">
    >>
    >> Any help would be greatly appreciated
    > Why didn't the IF work?
    > What was the error (if it was an error)?
    > <?php
    > // ...
    > if ($ok_to_output_the_submit_button) {
    > echo '<input type="submit" value="Update"/>';
    > }
    > // ...
    > ?>
    > --
    > .sig
    I get the idea he might not understand the concept
    of server side and what echo is doing yet. ie that
    you are dynamically emitting the html that client
    side will see inside the <?php ... ?>
    hopefully these are lightbulbs :)
    -Walt

    --
    Reply to innkeepATcapitalDOTnet to email questions.


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    [url]http://www.newsfeeds.com[/url] - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    PenguinsAnonymous Guest

  11. #10

    Default Re: Submit Button

    On Wed, 12 Nov 2003 21:53:40 -0000, "Jimbo" <Jim@garner21.freeserve.co.uk>
    wrote:
    >I am trying to right a script so that the "submit button" only appears when
    >certain criteria has been met. I have tried putting it in an IF statement,
    >without any luck. Maybe a function would allow me to do this?
    >
    ><input type="Submit" value="Update">
    >
    >Any help would be greatly appreciated
    Not enough information really; it sounds to me like you're not after a PHP
    solution though.

    Since the only way to make PHP aware of new information is to at least do a
    page request, and probably as a result of submitting a form, then you can't
    change any conditions if you don't have a submit button in the first place.

    Are you looking for something that can reveal a submit button when certain
    fields have all been filled in on the client browser? If so, you need to ask in
    a JavaScript group.

    --
    Andy Hassall (andy@andyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    Space: disk usage analysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Andy Hassall Guest

  12. #11

    Default Re: Submit Button

    (supersedes <mesnews.65977d3b.a2a60f12.127.2689@free.fr.Remove this>)

    "Jimbo" a écrit le 12/11/2003 :
    > I am trying to right a script so that the "submit button" only appears when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    >
    > <input type="Submit" value="Update">
    >
    > Any help would be greatly appreciated
    >
    > TIA
    >
    > Jim
    You'll do that with Javascript not with PHP which is server-side
    executed.

    PS : Please don't multi-post FU2 comp.lang.php


    Jedi121 Guest

  13. #12

    Default Re: Submit Button

    > You'll do that with Javascript not with PHP which is server-side
    > executed.
    > PS : Please don't multi-post FU2 comp.lang.php
    This 'can' be handled server side if he wants to.
    Are you saying he can't emit the html for the form
    server side? (which is presented client side)
    -Walt


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    [url]http://www.newsfeeds.com[/url] - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    PenguinsAnonymous Guest

  14. #13

    Default Re: Submit button

    > I am trying to right a script so that the "submit button" only appears
    when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    >
    > <input type="Submit" value="Update">
    >
    > Any help would be greatly appreciated
    maybe give a bit more info on what you need, remember tho that php is a
    server side language so if for example you wish the submit button only to
    display or be active when a certain field is filled in on a form then that
    is a job for javascript, php would only know if it is filled in when the
    person has submitted it.


    Filth Guest

  15. #14

    Default Re: Submit button

    *** Jimbo wrote/escribió (Wed, 12 Nov 2003 21:49:59 -0000):
    > I am trying to right a script so that the "submit button" only appears when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    PHP is executed *before* sending page to client, I can't figure out a way
    to use it for your purpose. However, you could try some good old
    client-side JavaScript. Give your submit button the DISABLED attribute and
    enable it once the requirements are met.


    --
    --
    -- Álvaro G. Vicario - Burgos, Spain
    --
    Alvaro G Vicario Guest

  16. #15

    Default Re: Submit Button

    Of course you can:

    <?php
    if($criteria){
    echo "<input type='submit' blahblahblah>";
    }
    ?>


    "Jedi121" <jedi121news@free.fr.Removethis> wrote in message
    news:mesnews.68357d3b.1ee8d502.128.2689@free.fr.Re movethis...
    > (supersedes <mesnews.65977d3b.a2a60f12.127.2689@free.fr.Remove this>)
    >
    > "Jimbo" a écrit le 12/11/2003 :
    > > I am trying to right a script so that the "submit button" only appears
    when
    > > certain criteria has been met. I have tried putting it in an IF
    statement,
    > > without any luck. Maybe a function would allow me to do this?
    > >
    > > <input type="Submit" value="Update">
    > >
    > > Any help would be greatly appreciated
    > >
    > > TIA
    > >
    > > Jim
    >
    > You'll do that with Javascript not with PHP which is server-side
    > executed.
    >
    > PS : Please don't multi-post FU2 comp.lang.php
    >
    >

    Michel Guest

  17. #16

    Default Re: Submit Button

    No you can't he said he wanted the submit button to appear when the form
    meat a criteria, this is only done with JS, not php

    Savut

    "Michel" <please_no@spam.nl> a écrit dans le message de
    news:bovgv0$9io$1@news.cistron.nl...
    > Of course you can:
    >
    > <?php
    > if($criteria){
    > echo "<input type='submit' blahblahblah>";
    > }
    > ?>
    >
    >
    > "Jedi121" <jedi121news@free.fr.Removethis> wrote in message
    > news:mesnews.68357d3b.1ee8d502.128.2689@free.fr.Re movethis...
    > > (supersedes <mesnews.65977d3b.a2a60f12.127.2689@free.fr.Remove this>)
    > >
    > > "Jimbo" a écrit le 12/11/2003 :
    > > > I am trying to right a script so that the "submit button" only appears
    > when
    > > > certain criteria has been met. I have tried putting it in an IF
    > statement,
    > > > without any luck. Maybe a function would allow me to do this?
    > > >
    > > > <input type="Submit" value="Update">
    > > >
    > > > Any help would be greatly appreciated
    > > >
    > > > TIA
    > > >
    > > > Jim
    > >
    > > You'll do that with Javascript not with PHP which is server-side
    > > executed.
    > >
    > > PS : Please don't multi-post FU2 comp.lang.php
    > >
    > >
    >
    >

    Savut Guest

  18. #17

    Default Re: Submit Button

    Warren Oates <Warren@inhell.com> wrote:
    > In article <3fb2d071$1_7@corp.newsgroups.com>, PenguinsAnonymous wrote:
    > :This 'can' be handled server side if he wants to.
    > :Are you saying he can't emit the html for the form
    > :server side? (which is presented client side)
    > :-Walt
    > I'm assuming that he wants to make sure all the fields are filled in
    > before allowing a submit to happen. With JS this can be very easily done
    > (out on Highway 61),
    > if(blahBlah) {document.write "<blah>";}
    > or something, my JS syntax is rusty.
    >
    > As Andy H. pointed out, to do it on the server, he'll have to submit the
    > form to be validated first. And probably have a session running too, if
    > he's using the same page. I've got some examples of this, but my coding
    > is a bit sloppy.
    > --
    > Looks like more of Texas to me.
    > ... Arizona, where the nights are warm and the roads are straight.
    DOH of course ..... you must be right.
    funny thing, he probably gave up reading the thread :)

    -Walt


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    [url]http://www.newsfeeds.com[/url] - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
    PenguinsAnonymous Guest

  19. #18

    Default Re: Submit Button

    Jimbo wrote:
    > I am trying to right a script so that the "submit button" only appears
    > when certain criteria has been met. I have tried putting it in an IF
    > statement, without any luck. Maybe a function would allow me to do this?
    >
    > <input type="Submit" value="Update">
    >
    > Any help would be greatly appreciated
    >
    > TIA
    >
    > Jim
    You definatly want JavaScript here. Even though this is a PHP group, I'll
    give you the JS for free

    <form name="inputform">
    <input type="text" name="field1" value="" onblur="javascript:validate();" />
    <input type="text" name="field2" value="" onblur="javascript:validate();" />
    <input type="submit" name="submit" value="Submit" disabled
    onclick="javascript:disable();" />
    </form>
    <script language="JavaScript">
    function validate(){
    if(document.inputform.field1.value != ""){
    if(document.inputform.field2.value != ""){
    document.inputform.submit.disabled = false;
    }
    }
    }
    function disable(){
    document.inputform.submit.disabled = true;
    document.inputform.submit.value = "Please wait... Form is being
    submitted.";
    }
    </script>


    Obviously you will have to edit your form/javascript validation for your
    page, but this is the basic idea of what you need to do. With this, it
    will be impossible for the user to push the submit button until everything
    is validated. It will also disable the submit button after the user clicks
    it to prevent double submitting by impatient users.
    Eric Kincl Guest

  20. #19

    Default Re: Submit button

    You can try with the following, I hope it can help you.
    Regards,
    Paolo


    <?
    $my_condition = getValueFromSomewhere();
    ?>

    <html>
    <body>
    <? if ( $my_condition == true ) { ?>
    <input type="Submit" value="Update">
    <? } ?>
    </body>
    </html>





    Il Wed, 12 Nov 2003 21:49:59 -0000, "Jimbo"
    <Jim@garner21.freeserve.co.uk> ha scritto:
    >I am trying to right a script so that the "submit button" only appears when
    >certain criteria has been met. I have tried putting it in an IF statement,
    >without any luck. Maybe a function would allow me to do this?
    >
    ><input type="Submit" value="Update">
    >
    >Any help would be greatly appreciated
    >
    >TIA
    >
    >Jim
    >
    >
    Paolo Guest

  21. #20

    Default Re: Submit button

    If you refresh the page after a user performs an action, you can check to
    see if fields are updated and your button will show. Because PHP is executed
    before sending the page to the client, the conditions of change have to be
    detected on a page refresh.

    Albert

    "Jimbo" <Jim@garner21.freeserve.co.uk> wrote in message
    news:bou9rj$d0$1@newsg3.svr.pol.co.uk...
    > I am trying to right a script so that the "submit button" only appears
    when
    > certain criteria has been met. I have tried putting it in an IF statement,
    > without any luck. Maybe a function would allow me to do this?
    >
    > <input type="Submit" value="Update">
    >
    > Any help would be greatly appreciated
    >
    > TIA
    >
    > Jim
    >
    >
    >

    alauts 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