Conditioning an element on a form...

User 2869370 Photo


Registered User
15 posts

My web form is used to allow people to register for a convention. One of the items for which registrants can sign up will be free to the first 30 registrants and $10 for each registrant thereafter. The Form Builder does not provide this capability. However, perhaps I can modify the code produced by Form Builder to allow me to track the number of registrants for this particular item and, if there are fewer than 30 registered, indicate no charge and, if there are 30 or more registered, indicate the $10 charge. Can anyone provide any guidance or direction to help me accomplish this?
User 10077 Photo


Senior Advisor
1,095 posts

Can you post a link to the form so we can view > source and look at the form code?
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 2869370 Photo


Registered User
15 posts

You'll find the form at: http://merregistrar.coffeecup.com/forms … istration/

The particular item of interest is indicated as "201: North Carolina Transportation Museum."
User 187934 Photo


Senior Advisor
20,186 posts

Hi Kirk,
Are you using a myql database to keep track of the form results?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2869370 Photo


Registered User
15 posts

Hi Eric,

Thanks for your reply. No, I am not using a database. So far, the CSV file produced by the registration process and provided by CoffeeCup has met my needs, but I figure that it is not going to get me through my current problem. I'm not very familiar with databases, but I'm certainly willing to learn. Any guidance you can provide will be much appreciated.
User 187934 Photo


Senior Advisor
20,186 posts

I can work with a csv file. Give me a bit to do some testing.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,186 posts

Sorry for the delay but I see your form is hosted on Coffeecup. Is it always going to be hosted there or is it only for testing? I can't do the customized php code if it's on S-Drive.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2869370 Photo


Registered User
15 posts

Yes, for now my only option is to host the form on CoffeeCup. However, given that I would very much like to have some additional capability that, as you’ve indicated, requires PHP, I will inquire of my organization’s webmaster about other options for hosting the form. I’ll get back to you soon.
User 2869370 Photo


Registered User
15 posts

A year later, and I'm now familiar with how to set up my form on my own server and have gained some knowledge about web applications, mySQL, and PHP. Right now I have the form working on my local machine (localhost), where I'm planning to do additional development to ready the form for the production environment.

I developed some PHP code to allow dynamic content to be placed in the form, but I'm stumped as to where I should place this code. I intended to drop it right into the HTML file that form builder generates, but then I discovered that I cannot run PHP code within an HTML file on my server. If I simply change the extension of the HTML file produced by the form builder to .php, it no longer works, i.e., the form no longer appears in the browser. It seems the code that CoffeeCup generates to initiate the form can no longer find it. So, do I need to somehow intercept the form before it is sent to the user's browser, run the PHP code to update the content, and then send it on its way to the user's browser?

Can anyone provide some guidance as to how I should proceed?
User 187934 Photo


Senior Advisor
20,186 posts

Hi Kirk,
If your using the iframe code provided by the Form Builder you have to change the src to match the extension change of your myformname.html to myformnme.php.
<iframe src="myformname.html"></iframe>

<iframe src="myformname.php"></iframe>

I will need to know what your trying to do with the php code your adding to the form. Is it for a select or an input?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.