This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Form "X" checking required fields of Form "Y"


  1. jacorley
    Member

    UPDATE - I removed my added session variable from post-functions and still no go.

    Also, I am using the recommended javascript to display my forms. I am currently using the code inside a wordpress post. I have tried moving it to a page template and the results are the same.
    ________

    My users submit one form. I email them a verification code, which they enter on a second form on the redirect page.

    When they submit to the second form, it is checking required fields from the first form and displaying the the form to fill in the required fields.

    I am carrying some session variables to be able to use form data on the redirect page. Would that cause this?

    First form example: http://www.drainagehelp.com/pro/service-areas/north-carolina/raleigh-nc/
    The second form (and redirect page from form 1 submission) - http://www.drainagehelp.com/pro/verify/

    To see what is going wrong, try submitting the second form. It will display the empty fields error and display form 1.

    Thanks in advance.

    -Jeff

    Posted 12 years ago #
  2. jacorley
    Member

    Now I have noticed that in the machform admin, if I select view on form 4, it displays what it says is form 4 but it shows form 1. It seams form #1 is overriding every other form.

    Posted 12 years ago #
  3. jacorley
    Member

    Problem solved...partially...

    Posted 12 years ago #
  4. yuniar

    Hi Jeff,

    What's the remaining problem?


    MachForm Founder

    Posted 12 years ago #
  5. jacorley
    Member

    I had added some custom code to view-functions to dynamically select a different CSS file if a mobile browser is present. It worked great until I created a third form. I had two forms that were identical except for one has multiple columns and the other had one column (needed this because the mobile browser really screwed up the multiple columns.)

    For some reason, the CSS reference altered the form the data was submitted to in post-functions. It always thought the data was from form 1.

    Basically all I need now is a way to display the css for form one normally and to display the css for form 2 when a mobile browser is detected. I am alwaysndisplay form 1 using javascript i am just tricking the mobile browsermto display it properly I know the code to properly detect the browser and thought i knew how to alter the CSS source, I just obviously put it in a bad place or underestimated the effects of changing the CSS source

    With the code I added, when I view source it worked perfectly until the form was submitted. When form one was displayed source showed CSS for form 1. When viewed in mobile browser, showed form 2 CSS which is what I wanted to happen.

    Posted 12 years ago #
  6. jacorley
    Member

    This is what I was using...

    //check for specific form css, if any, use it instead
    if($form->has_css){
    if ($form->id = "1"){
    if(!preg_match('/(symbian|smartphone|phone|android)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) {
    $css_dir = $mf_settings['data_dir']."/form_{$form_id}/css/";
    }
    else {
    $css_dir = $mf_settings['data_dir']."/form_3/css/";
    }
    }

    Posted 12 years ago #

RSS feed for this topic

Reply