newbie question - how do you *require* a response?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Harlett O'Dowd

    newbie question - how do you *require* a response?

    Please forgive this newbie question but java is new to me and I'm
    still trying to find a course in my area.

    I'm tweaking an online survey and have gotten it to display what I
    want but can't figure out how to *require* the surveyee to pick a
    choice.


    For each of ten questions, the surveyee is asked:


    _______________ ______________


    <select name="proposal1 " size=1>
    <option>Pleas e Choose one option from the list below</
    option>
    <option>Approve </option>
    <option>No Opinion</option>
    <option>Objec t - The technical approach is not sound</
    option>
    <option>Objec t - The proposed project duplicates previous
    and publicly reported efforts</option>
    <option>Objec t - the proposal is not needed</option>
    <option>Objec t - Other - you <strong>MUST</stronggive a
    detailed response ine 'Comments' box below: </option>
    </select>


    <TABLE>
    <tr>
    <td></td>
    <td width="500"Comm ents:</td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td><textarea name=object-one rows=6 cols=80></textarea></td>
    </tr>
    </table>


    _______________ _______________ ________


    Ideally, I'd like to script this so that if the surveyee does NOT
    choose one of the select pull-down options (or, more to the point,
    allows the default option "Please Choose one option from the list
    below" to ride) when s/he hits submit later down the page, s/he gets
    an error message instructing the user to return to the form and enter
    the appropriate answer.


    AND,


    if at all possible, if the surveyee choices the final option -
    "Object
    - Other - you <strong>MUST</stronggive a detailed response ine
    'Comments' box below" - the user will go to the same error page
    requesting that s/he go back and fill in the comments section for
    this
    proposal (in cthis case, the 'object-one' box)


    I've doen some googling on this but haven't found anything that seems
    to be a reasonable starting-off model to use.


    Thanks in advance for your help


    HOD
  • Stevo

    #2
    Re: newbie question - how do you *require* a response?

    Harlett O'Dowd wrote:
    Please forgive this newbie question but java is new to me and I'm
    still trying to find a course in my area.
    I don't recommend taking a course in Java. If you're tweaking an online
    survey, then you're more likely to find a course in JavaScript useful.

    Comment

    • sheldonlg

      #3
      Re: newbie question - how do you *require* a response?

      Harlett O'Dowd wrote:
      Please forgive this newbie question but java is new to me and I'm
      still trying to find a course in my area.
      >
      I'm tweaking an online survey and have gotten it to display what I
      want but can't figure out how to *require* the surveyee to pick a
      choice.
      >
      >
      For each of ten questions, the surveyee is asked:
      >
      >
      _______________ ______________
      >
      >
      <select name="proposal1 " size=1>
      <option>Pleas e Choose one option from the list below</
      option>
      <option>Approve </option>
      <option>No Opinion</option>
      <option>Objec t - The technical approach is not sound</
      option>
      <option>Objec t - The proposed project duplicates previous
      and publicly reported efforts</option>
      <option>Objec t - the proposal is not needed</option>
      <option>Objec t - Other - you <strong>MUST</stronggive a
      detailed response ine 'Comments' box below: </option>
      </select>
      >
      Put a value="somethin g or other" into each of the options. Then do an
      onclick for the submit button and check the value of each of the
      selects. I would make the value of the please choose as "empty", as an
      example. Then in the javascript I would check against "empty" and build
      and alert string. If at the end of the script there is something in the
      alert string, I would alert the user with that string. Otherwise, I
      would do a submit().

      Comment

      • Rich Grise

        #4
        Re: newbie question - how do you *require* a response?

        On Tue, 20 May 2008 05:42:41 -0700, Harlett O'Dowd wrote:
        Please forgive this newbie question but java is new to me and I'm
        still trying to find a course in my area.
        >
        I'm tweaking an online survey and have gotten it to display what I
        want but can't figure out how to *require* the surveyee to pick a
        choice.
        >
        For each of ten questions, the surveyee is asked:
        >
        <select name="proposal1 " size=1>
        <option>Pleas e Choose one option from the list below</
        option>
        <option>Approve </option>
        >
        Ideally, I'd like to script this so that if the surveyee does NOT
        choose one of the select pull-down options (or, more to the point,
        allows the default option "Please Choose one option from the list
        below" to ride) when s/he hits submit later down the page, s/he gets
        an error message instructing the user to return to the form and enter
        the appropriate answer.
        If you use radio buttons with "Please Choose..." as the default, it will
        already have been filtered - and if the answer is "Please Choose...", your
        script would send them back with an admonition.

        I've almost already got this one written in my head using perl/CGI
        but that's OT for the NG. ;-)

        Good Luck!
        Rich

        Comment

        Working...