Customize the form

In this tutorial I am going to show you how to customize the ask me form. Open up questions.php(or index.php if you changed the file name). You will find there this line of coding:

<p>There are currently <?php echo doCount(“done”); ?> answered, and <?php echo doCount(“open”); ?> unanswered questions.</p>

I added some text effects on mine. Here it is:

<em>There are currently <strong><?php echo doCount(“done”); ?></strong> answered, and <strong><?php echo doCount(“open”); ?></strong> unanswered questions.</em>

Now for the actual form, open functions.php file and search for this line of coding:

<form action=”ask.php” method=”post”>
<p>
<span style=”display: none;”><input type=”checkbox” name=”human” id=”human”> <label for=”human”>Leave this unticked if you’re human :)</label>></span><br>
<?php
if ($showname == “yes”) {
?>
<input type=”text” name=”name” id=”name”> <label for=”name”>Name</label><br>
<?php
}
?>

THIS IS WHAT I CHANGED:

<input type=”text” name=”question” id=”question”> <label for=”question”>Question</label>
<input type=”submit” value=”Ask”>
</p>
</form>

I wanted mine form to have no labels and I moved the question label inside the form. This is my code:

<form action=”ask.php” method=”post”>

<span style=”display: none;”><input type=”checkbox” name=”human” id=”human”> <label for=”human”>Leave this unticked if you’re human

:)</label></span><br>
<?php
if ($showname == “yes”) {
?>
<input type=”text” name=”name” id=”name”> <label for=”name”>Name</label><br>
<?php
}
?>

THIS IS WHAT I CHANGED:

<div align=”center”><input type=”text” name=”question” id=”question” value=”Question” onfocus=”if

(this.value == ‘Question’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value =

‘Question’;}”> <input type=”submit” value=”Ask”>
</div>
</form>

Basically I only changed the last lines of codes for the Question field and the ask button. Feel free to customize it as you wish. If you want to display the name field, you have to modify it too. This is how you customize your ask-me form. It looks like this: