Monday, 19 August 2013

Hiding and revealing form field submission output

Hiding and revealing form field submission output

I'm a first time asker, and I'm still unclear on a lot of the language on
all sides of programming, so please excuse the simple minded nature of my
question:
I have a form with three fields:
<form method="get">
<div class="bday_forms">
<label for="first_name">What is your first name?</label>
<input id="first_name" name="first">
<br/>
<label for="last_name">What is your last name?</label>
<input id="last_name" name="last">
<br/>
<label for="your_bday">When is your birthday?</label>
<input id="your_bday" name="bday">
</div>
<div class="bday_button">
<button class="btn btn-default" type="submit">Gimme</button>
</div>
</form>
Simple enough. Following is the following "output div", which prints out
the above form fields after submission:
<div>
<%= params["first"]%> <%= params["last"]%> was born on <%=
params["bday"]%>.
</div>
What I want to do now is hide the whole "output div" above if the fields
have not been filled and submitted, and to reveal it once they have.
I think this mean I need to use an if/else/end command and boolean
true/false values. Help, please! Thanks

No comments:

Post a Comment