Confused as to how to pre populate forms without php
-
Alright,
I am new to WordPress so please forgive my ignorance, I am used to hand-coding EVERYTHING My new job is forcing WordPress on me and I am hoping to find it amazing…but with this huge problem is making it hard.I have this site which has a form, on submission I want to validate and display error messages and pre-populate the form with the submitted values upon return.
The issue is that I can not use php…I am completely confused how anyone does this without php.
Here’s a sample:`
<form method=”post” action=”formtest.php” onsubmit=”return validateForm()”>
<p>1. Do you spend at least 10% of your time executing on your written plan to grow your business? <?php echo $error[1]; ?><br/>
<input type=”radio” value=”1″ name=”q1″ document.write(q[1][2])Always<br/>
<input type=”radio” value=”2″ name=”q1″ <?php echo $q[1][2]; ?> />Most of the time<br/>
<input type=”radio” value=”3″ name=”q1″ <?php echo $q[1][3]; ?> />Sometimes<br/>
<input type=”radio” value=”4″ name=”q1″ <?php echo $q[1][4]; ?> />Not very often<br/>
<input type=”radio” value=”4″ name=”q1″ <?php echo $q[1][5]; ?> />Never</p><p>2. Do you receive meaningful, accurate, and timely financial reports every month by the 10 <?php echo $error[2]; ?><br/>
<input type=”radio” value=”1″ name=”q2″ <?php echo $q[2][1]; ?> />Always<br/>
<input type=”radio” value=”2″ name=”q2″ <?php echo $q[2][2]; ?> />Most of the time<br/>
<input type=”radio” value=”3″ name=”q2″ <?php echo $q[2][3]; ?> />Sometimes<br/>
<input type=”radio” value=”4″ name=”q2″ <?php echo $q[2][4]; ?> />Not very often<br/>
<input type=”radio” value=”4″ name=”q2″ <?php echo $q[2][5]; ?> />Never</p><p>3. Do you receive meaningful, accurate, and timely financial reports every month by the 12 <?php echo $error[3]; ?><br/>
<input type=”radio” value=”1″ name=”q3″ <?php echo $q[3][1]; ?> />Always<br/>
<input type=”radio” value=”2″ name=”q3″ <?php echo $q[3][2]; ?> />Most of the time<br/>
<input type=”radio” value=”3″ name=”q3″ <?php echo $q[3][3]; ?> />Sometimes<br/>
<input type=”radio” value=”4″ name=”q3″ <?php echo $q[3][4]; ?> />Not very often<br/>
<input type=”radio” value=”4″ name=”q3″ <?php echo $q[3][5]; ?> />Never</p><p>4. Do you understand those financial reports and consistently use the information they provide to assist you in managing the business and making good decisions? <?php echo $error[4]; ?><br/>
<input type=”radio” value=”1″ name=”q4″ <?php echo $q[4][1]; ?> />Always<br/>
<input type=”radio” value=”2″ name=”q4″ <?php echo $q[4][2]; ?> />Most of the time<br/>
<input type=”radio” value=”3″ name=”q4″ <?php echo $q[4][3]; ?> />Sometimes<br/>
<input type=”radio” value=”4″ name=”q4″ <?php echo $q[4][4]; ?> />Not very often<br/>
<input type=”radio” value=”4″ name=”q4″ <?php echo $q[4][5]; ?> />Never</p><p>Your Name (required) <?php echo $error[21]; ?><br />
<input type=”text” name=”clientName” size=”40″ value=”<?php echo $clientName; ?>” /></p><p>Your Company (required) <?php echo $error[22]; ?><br />
<input type=”text” name=”clientCompany” size=”40″ value=”<?php echo $clientCompany; ?>” /></p><p>Your Title (required) <?php echo $error[23]; ?><br />
<input type=”text” name=”clientTitle” size=”40″ value=”<?php echo $clientTitle; ?>” /></p><p>Your Phone (required) <?php echo $error[24]; ?><br />
<input type=”text” name=”clientPhone” size=”40″ value=”<?php echo $clientPhone; ?>” /></p><p>Your Email (required) <?php echo $error[25]; ?><br />
<input type=”text” name=”clientEmail” size=”40″ value=”<?php echo $clientEmail; ?>” /></p><p>Comments<br />
<textarea rows=”10″ cols=”40″ name=”clientComments”>
<?php echo $clientComments; ?>
</textarea></p><p><input type=”submit” name=”submit” /></p>
</form>`I have the code that runs in the header in the template file, but how do i output the values from the validation….I’m completely lost as to how this works.
- The topic ‘Confused as to how to pre populate forms without php’ is closed to new replies.