Forums

possible to not reset form if anti-spam is wrong?

rodsdesign 15 Feb, 2008
on a really long form, that would be a great thing...

is there a way?

thanks!
GreyHead 15 Feb, 2008
Hi rodsdesign,

See this FAQ hmmmm . . . didn't I just post that somewhere else?

Bob
rodsdesign 15 Feb, 2008
Sorry Bob,

I really did do a search...😟

but thanks for the FAQ

by the way - I think there's an error on the FAQ for <option>

shouldn't it be:

<select name="select">
<option value="ABC" <?php if ($_POST['select']) == 'ABC') echo ' selected="selected"'; ?>>ABC</option>

etc... ?

I know I had to add the value="ABC" and the double quotes around "selected" to get it to work.

thanks again for all you do on this forum. Chronoforms is one of the best extensions for Joomla!

Rod<br><br>Post edited by: rodsdesign, at: 2008/02/15 07:01
GreyHead 15 Feb, 2008
Hi Rod,

That code looks good - I'll summon up the energy to fix the FAQ - the editor there is horrid!

Bob
mike420 13 Mar, 2008
Hi,

I have added the code below to my form html, but I can't get it to work.

<select name="edityesno" size="1" class="inputbox">
    <option value="none" selected="selected">Please Select</option>
    <option value="yes" <?php if ($_POST['edityesno']) == 'yes') echo 'selected="selected"'; ?>>Yes</option>
    <option value="no" <?php if ($_POST['edityesno']) == 'no') echo 'selected="selected"'; ?>>No</option>
    </select>


Now when I try and view my form I get this error message:

Parse error: syntax error, unexpected T_IS_EQUAL in /home/mike420/public_html/components/com_chronocontact/chronocontact.html.php(81) : eval()'d code on line 30


Any ideas what I'm doing wrong?
Max_admin 13 Mar, 2008
Hi, remove the extra wrong bracket ) after the POST variable in the 2 if statements : $_POST['edityesno']) -> $_POST['edityesno']

Cheers

Max

P.S: you can also have only echo 'selected'; for simplicity!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.