We have already added a link for
submitting comments. Let's see how we can develop the code for it.
Chapter 10
[ 195 ]
Time for Action: Submitting Comments
1. Let us add the comment form to recipe.inc.php first. We will keep it in a
and hide it by default. This will save some screen space. Below is the
form code.
2. In the link we added, we have set the href to #commentForm, which is the
anchor ID. The page will scroll to the form when the link is clicked. Let us
write a function that will show the form if it's hidden, and hide it if
it's visible.
function ShowCommentForm()
{
var elm = document.
Pages:
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262