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

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Passing data from table to form


  1. idckamikaze
    Member

    I have an unique situation. I have used MachForm to create a user registration page. I read in a previous post that there's no way to add a password field to the form, but it wasn't a big deal to me as my users are given a password. I used the table created by the form to make a login to another form that has page restrictions based on the username and password from the user registration form info. The user registration form had additional fields for name, address, phone number, and e-mail that I need passed on to the main form.

    An easy solution would be to make the main form password-protected and give the users that need access to it the password. However, each user has unique info that needs to go with the form. I need to save the user time by not having to enter that information into the form every time. My thought was creating a session that pulled the necessary information from the user reg table, but I don't know how it would be able to pass this on to my second form. This kind of stuff is foreign to me, but I would understand it if given some direction. I was hoping someone had run into something similar, or if there are some resources out there that I'm not finding through Google.

    Posted 16 years ago #
  2. yuniar

    Ok, so you have two forms:
    1) Registration form
    2) Main form

    After submitting the registration form, your user would be redirected to the main form.
    Then, the main form should pull the necessary data from registration form.

    Am I right?

    Is there any chance you could post the URL to your forms?


    MachForm Founder

    Posted 16 years ago #
  3. idckamikaze
    Member

    You've got the idea. I need to administer the users before they can use the form, and I also need the data from their profile to pass on to the form every time they submit it. The Locate Form has a section for "Company Information". That's what I'm trying to get passed on from the profile to the form each time it's submitted. In the final version you would only see "Information for locate request".
    I already have the registration form setup, so I will add you to the users so you can view the form. At this page you'll be able to see the process and when you login, it redirects to the form the user will fill out, usually on a daily basis. The data from the main form will get pulled out the database by another application that I'm not developing.

    http://www.aligningchange.com/ms1call/user_landing.php

    You can login with the username: xxxx and password: machform

    ---
    admin edit: removed the email address. don't paste email in the forum please. spam prevention.

    Posted 16 years ago #
  4. idckamikaze
    Member

    Sorry about the e-mail thing.

    As I think about it more, it seems like what I need to do is add the contact data into the session variables. What happens in MachForm when you make a field "Admin Only"? Does it make the field =hidden in the form? If that's the case, couldn't I pass the session info on to the hidden fields on POST?

    Posted 16 years ago #
  5. yuniar

    I've been thinking about this for a while and session is one good option.
    Another option is to plug a custom query into your Locate Form to pull the necessary info from the database and populate it to the form.

    Check this post to learn how to populate a field with custom value:
    http://www.appnitro.com/forums/topic/dynamic-content-php?replies=12#post-304

    In the above sample, the field is being populated from GET parameter.
    You can adjust it to get values from session or queries of course.

    I don't think "Admin Only" would work, as it won't make your fields hidden. Instead, admin only field is not being shown at all.

    A good way to create hidden fields is by modifying the CSS code.
    If you checked the form, each field is being enclosed by a "li" with unique id.

    Using the unique id for each "li", you can simply set the display property of that element to hidden.

    For example:

    #li_4 {
      display: none;
    }

    That would hide your field from user, but yet the value is being passed.


    MachForm Founder

    Posted 16 years ago #
  6. idckamikaze
    Member

    display: none never works for me. I've used visibility: hidden before and it works, but it ends up leaving large gaps where the fields were (I added =hidden to Phone Number on my form as an example, but I'm sure you know what I'm talking about). Is there a certain placement in the CSS file where "display: none" needs to be?

    Also, for future releases, could you consider changing your CSS element names to something more specific like .embed #mf-footer instead of .embed #footer? My stylesheet "#footer" ends up overriding your stylesheet's footer when I embed it.

    Posted 16 years ago #
  7. yuniar

    That's odd.

    Try to edit the CSS of this form:
    http://www.aligningchange.com/ms1call/user_landing.php

    Add this CSS code into the bottom of your current CSS:

    #li_5{
      display: none;
    }

    That should hide the "Company/Organization" field and leave no gap.

    Regarding the CSS element names, sorry about that. I've just realized it after version 2 being released. I'll figure out a way to change this without breaking current forms.


    MachForm Founder

    Posted 16 years ago #

RSS feed for this topic

Reply