TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 490
  • Total: 490

How about a FORM? PHP Article or Block Code

Started by rumboogy, April 02, 2008, 08:50:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rumboogy

I looked...and couldn't find anything like I am asking for...a form for members to answer questions or provide info and then display in a table with the answers.

An example:

I want to PLAN AN EVENT, and I need to know the following:

The Best Date for you to attend.
Will you be bringing someone?
Items you will bring.
Will you be camping?

So really that is it. Just a short form for members to fill out and then I want to be able to display in a table (probably in a PHP article).

This can almost (actually it can be done) with some code that JPDeni has written, but the problem is that it uses the custom field MOD and if used for other custom fields...it gets pretty tedious to look at...

Is this a possibility with TP? Or would an external "scheduling" program work better.

Thanks,

Wally

G6Cad

I think you will be able to find a "fill in form" script through google you can use in eather php article or block. might even find a script that does this and add into a scriptblock

JPDeni

The Custom Profile field thing works very well for something that's in the profile, but you're looking to have a separate page for this, I think.

I was playing around with an article that would allow for creating forms on the fly -- you define the field parameters in variables and the program uses it to create the form. I had really only got to the point where I defined the fields and didn't do anything with them, but this could be a use for what I've already done.

This is the picture I got in my head from what you said...

A user comes to the article. A table is displayed with previous information. (A note on this later). Below that are links. If the user has not entered anything, there is a link to add information. If the user has entered information previously, there is a link to modify information. If it's a guest, there's no links.

If they click a link, a form is displayed. If they have already entered information, that info is entered into the form fields.

When they click the submit button, there's a check to see if the user has entered data into required fields (set in the field parameters section). If everything is okay, the values are added to a database table and the page with the form is once again displayed.

Is this what you're looking for?

That promised note about the displayed table... It's my experience that the tables can be too wide for a user's screen and the right side of the table can be cut off. I haven't been able to get scrollbars to work on them either.

rumboogy

Deni...that is pretty much it in a nutshell.  You mentioned the problems with a displayed table...is there another way to display info.

Just to make sure we are on the same page...here is exactly what I want it for:

A group of us bikers are planning a getaway and trip about 150 miles away. I want a table to show who is gonna go (member), what dates (weekends) they are available (probably short free text), also what they can bring (another short text field), and maybe a final field for additional info (another text field).

So is this do-able?

Thanks for responding...I LOVE the PHP article thing...I have in use in TWO PHP articles on my Arkansas Biker Site.

Thanks,

Wally

rumboogy

Deni, was this just too difficult...I was afraid it might be.

Thanks,

Wally

JPDeni

No, not too difficult. I just didn't see your earlier response. :)

It may take a little bit to do, because I'm trying to work out a general thing that you can use over and over again for whatever purposes you can think of. And others will be able to use it for their own purposes as well.

I have the code for creating the form all written. You can define text fields, checkboxes, radio fields, select fields and textareas, each with their own caption. (I borrowed the idea from a perl-based database that I used to work with a long time ago.) I think that this was the most difficult part, so the rest should be easy. (Famous last words!! :D)

As soon as I finish my morning cup of chai :) I'll get to working on it and see how far I can get in a day. It's a heck of a lot better than watching daytime tv!!

rumboogy

Cool...I might be able to use it on this very event...I have held off using the Custom Profile Fields till I heard back from you.

Wally

JPDeni

It's in the works. Of course, nothing ever goes as planned. :)

I'm still not sure what to do about the tables thing. I used a "bandaid" approach and just limited it to 600 pixels wide, which should fit for most people. But it looks ugly.

rumboogy

Is it functional? Why is it ugly...

Ugly is in the eye of the BeForumer.    :)

Wally

JPDeni

Yeah, it's functional. You can see how ugly it is --

http://www.morethanspike.com/index.php?page=29

All scrunched together. I don't like it, but if I let it go as wide as it wants to go some of my members can't see the far right columns.

(BTW, you may notice that I changed mine to use images, based on your suggestion. :) )

This website is proudly hosted on Crocweb Cloud Website Hosting.