required field vs disabled submit button.in a form

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default required field vs disabled submit button.in a form

    I'm trying to make my email field required. Have seen and tried multiple
    solutions from this forum, with no success. I think it has something to do
    with the line of code <input type="button" value="Continue"
    onclick="page1.submit();"> I used to disable the enter button from submiting
    the form. Is this somehow incompaible wih the required="yes" command?

    I have had some limited success with the onBlur validate command that DWeaver
    uses to insert some simple javascript, but it doesn't seem to work in all
    cases.

    Thanks in advance. Love this forum.

    snark66 Guest

  2. Similar Questions and Discussions

    1. Required Form Field Ext.
      Are there any extensions available for forms built in Dreamweaver MX 2004 that require the form user to fill in all fields. I have one that kind of...
    2. submit button on a form
      i am developing a new web page and i am creating a form which has 10 text fields aand i have set the action to mailto:eamil address but the form...
    3. Web Form Required Field
      Not supported. For more form help see - http://www.publishermvps.com/Default.aspx?tabid=30 -- David Bartosik - MS MVP for Publisher help:...
    4. Form Submit Button
      Should be a quickie but I just can't get it to work. I have a form where my users can submit their football picks, when they click submit I would...
    5. Form Field/ Form Submit Problems (probably an easy answer...)
      Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works...
  3. #2

    Default Re: required field vs disabled submit button.in a form

    Is page1 the name of your page, or the name of your form?

    The problem you have to overcome is that:
    validateat defaults to onsubmit
    you don't have a submit button.

    If page1 is the not the name of your form, try putting in the name of your
    form.

    Dan Bracuk Guest

  4. #3

    Default Re: required field vs disabled submit button.in a form

    That's kinda what I figured (since it had worked on forms when I had a submit
    button). Form1 is the name of my form. Any other suggestions? The onBlur
    behavior that DWeaver wrote is nice, but seems insufficient to ensure the form
    has a email.

    snark66 Guest

  5. #4

    Default Re: required field vs disabled submit button.in a form

    look up qforms and see if that meets your needs.
    Dan Bracuk Guest

  6. #5

    Default Re: required field vs disabled submit button.in a form

    I looked up qforms and fear it is still a tad over my head (though I'm learning
    quickly). Any other suggestions?

    I mistyped earler - page1 is the name of my form, which I am referencing with
    <input type="button" value="Continue" onclick="page1.submit();">

    Could I change the button back to a submit button, add the required="yes" as
    an onblur event, and keep the enter button from submitting some other way? I
    don't want to disable it, just keep it from submitting.

    I apologize for my lack of javascipt expertise.

    snark66 Guest

  7. #6

    Default Re: required field vs disabled submit button.in a form

    What you want to accomplish requires javascript so, you'll either get good at
    it or you won't accomplish your goal.

    Try writing a javascript function that returns true if all the fields you want
    to have values have values, and false if they don't. Then, on your button,
    make your onclick attribute resemble
    onclick="if(return function()==true) this.form.submit();)"

    only with proper syntax.

    Dan Bracuk Guest

  8. #7

    Default Re: required field vs disabled submit button.in a form

    <script language=javascript>
    var submitAction="1";
    function submitByJavascript()
    {
    if(document.form1.email.value=="")
    {
    submitAction="0";
    }
    if(submitAction=="1")
    {
    document.form1.submit();
    }
    }
    </script>

    <form name=form1 action="actionpage.cfm" method=post>
    Email: <input type=text name="email"> <br>
    <input type=button name=butt value=submit onclick="submitByJavascript();">
    </form>

    reenaroy 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