Support » Fixing WordPress » conditional contact form elements

  • hi

    this is for an mu wordpress install, currently running 2.6.3, but will be upgraded by the end of the week.

    the client wants the contact page to conditionally have two forms, depending upon the visitor answer to a question.

    Something like:
    are you an existing customer?
    if yes, display form1
    if no, display form2.

    we had been using contact form 7 so far.
    the idea had been to create two separate forms, and then use a form/button/link to conditionally hide/display a form.
    (Each of the contactforms is wrapped in a different div. So we would initially have display:none for each form div, and use javascript to set the document id style display to block, depending upon whether the visitor selects yes or no.)

    The first main problem was that I could not use javascript code in my page.
    I’ve tried the raw_html plugin, the ayb-javasciprtinposts plugin, to no avail. I’ve turned off the wysiwyg editor, disabled it for my login, tried wrapping the line in [code] and every other folder.

    Although it’s as if I don’t get as far as the plugin.
    The moment that i had a touch of javascript onto my page, as soon as i hit Save, WordPress removes all evidence of the javascript. Even the onclick is removed, when i hit save.

    Does anyone have a reliable way of using javascript on a page?

    Alternatively, is there a better form program that we can use?
    We looked at cformsii, but although it has multi-part/page forms, they are not conditional – we can’t test the value of an earlier field, before deciding which other fields to display.

    Any ideas?

  • The topic ‘conditional contact form elements’ is closed to new replies.