javascript check form question

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default javascript check form question

    I have the following function to check a form:

    function Search_Form_Check(form) {
    if (document.reviewsearch.AY.value == "" &&
    document.reviewsearch.ddomenu.value == "" &&
    document.reviewsearch.reqname.value == "" && document.reviewsearch.dt.value ==
    "" && document.reviewsearch.status.value == "" &&
    document.reviewsearch.abrid.value == "")
    {
    alert ("Please select at least one search criteria.");
    return(false);
    }
    return(true);
    }

    I have two submit buttons:

    <input name="Submit" type="submit" id="Submit" value="Search">
    <input type="submit" name="Submit" value="My Reviews">

    When the user clicks the submit button with the value "Search" I want to run
    the form check function.

    When the user clicks the submit button value "My Reviews" I want to bypass
    running the function and just submit the page.

    How can I ammend the function to run only when the submit button value is
    "Search"?

    Thanks,
    -D-


    -D- Guest

  2. Similar Questions and Discussions

    1. AI CS Javascript: Check if a textFrame is filled / stroked?
      Hi, for a pathItem, i can check if it is filled by using the "filled" attribute. However, for...
    2. copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome?
      I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed...
    3. How to check whether client browser is JAVASCRIPT, COOKIES enabled and supports 128 bit encryption
      DON'T MULTIPOST. Ray at work "Jagan" <jaganmohan.thota@hyd.cognizant.com> wrote in message...
    4. Adobe Acrobat 5: Javascript question: How do I create a text form that...
      I recently came across a pdf file, its a regular page with forms. Nothing fancy I guess. However, the forms were set so that when you place your...
    5. Where is my Check Form
      "frozinorth" wrote: Sometimes you need to make sure that you have the correct browser audience selected. If you are showing available behaviours...
  3. #2

    Default Re: javascript check form question

    Try this:
    In your form tag if you have an onsubmit function, get rid of it and try the
    code below in your button elements.

    <input name="Submit" type="submit" id="Submit" value="Search"
    onclick='Search_Form_Check(this.form)'>
    <input type="submit" name="Submit" value="My Reviews">

    When the search button is clicked the function will be ran, and when the other
    button is pressed it will not.


    jman25 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