PHP Form Generator? Such a thing?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:evil: Shaving Cream :x
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Post by jmilane »

Okay guys:

I am using a Drupal module. It is a CRM module called CiviCRM.

It allows you to keep track of people. People like my registrants.

You can create custom data fields.

You can also create a custom profile - all the data that you want to track for the person - custom and standard.

It lets you create a standalone input form for this profile.

Problem is, there is no validation on it and when it is finished, you get taken to the site I dont want you to get taken to.

Long and short of it is: is this even php code? Can I stick validation on this? Make it so I can control what happens after it is submitted?

Here is a chunk of it:

Code: Select all

<form  action="http://127.0.0.1/drupal/drupal-4.7.3/index.php?q=civicrm/gid=2&reset=1" method="post" name="Edit" id="Edit">


  <input name="_qf_default" type="hidden" value="Edit:cancel" />
<input name="postURL" type="hidden" value="http://www.mysite.org" />



<div id="crm-container"> 
    <fieldset><legend>Intake Application</legend><div class="messages help">This form will be used to enter people into the database and register them with the system.</div><table class="form-layout-compressed"><tr><td class="label"><label for="first_name">  First Name
   <span class="marker">*</span>
</label></td><td><input maxlength="64" size="30" name="first_name" type="text" id="first_name" class="form-text big required" /></td></tr><tr><td class="label"><label for="middle_name">Middle Name</label></td><td><input maxlength="64" size="30" name="middle_name" type="text" id="middle_name" class="form-text big" /></td></tr><tr><td class="label"><label for="last_name">  Last Name
   <span class="marker">*</span>
</label></td><td><input maxlength="64" size="30" name="last_name" type="text" id="last_name" class="form-text big required" /></td></tr><tr><td class="label"><label for="qf_393e60">  Birth Date
   <span class="marker">*</span>
</label></td><td><select id="birth_date[M]" class="form-date required" name="birth_date[M]">
	<option value="">-month-</option>
	<option value="1">Jan</option>
	<option value="2">Feb</option>
(I deleted a bunch for the sake of brevity)
</select>&nbsp;<select id="birth_date[d]" class="form-date required" name="birth_date[d]">
	<option value="">-day-</option>
	<option value="1">01</option>
	<option value="2">02</option>
(I deleted a bunch for the sake of brevity)
</select>&nbsp;<select id="birth_date[Y]" class="form-date required" name="birth_date[Y]">
	<option value="">-year-</option>
	<option value="1906">1906</option>
	<option value="2005">2005</option>
	<option value="2006">2006</option>
(I deleted a bunch for the sake of brevity)
</select></td></tr><tr><td class="label"><label for="street_address-1">  Street Address (Home)
   <span class="marker">*</span>
</label></td><td><input maxlength="96" size="45" name="street_address-1" type="text" id="street_address-1" class="form-text huge required" /></td></tr><tr><td class="label"><label for="city-1">  City (Home)
   <span class="marker">*</span>
</label></td><td><input maxlength="64" size="30" name="city-1" type="text" id="city-1" class="form-text big required" /></td></tr><tr><td class="label"><label for="state_province-1">  State (Home)
   <span class="marker">*</span>
</label></td><td><select name="state_province-1" id="state_province-1" class="form-select required">
	<option value="">- select -</option>
	<option value="1000">Alabama</option>
</select></td></tr><tr><td class="label"><label for="postal_code-1">  Postal Code (Home)
   <span class="marker">*</span>
</label></td><td><input maxlength="12" size="12" name="postal_code-1" type="text" id="postal_code-1" class="form-text twelve required" /></td></tr><tr><td class="label"><label for="phone-1-Phone">  Phone (Home)
   <span class="marker">*</span>
</label></td><td><input maxlength="32" size="20" name="phone-1-Phone" type="text" id="phone-1-Phone" class="form-text medium required" /></td></tr><tr><td class="label"><label for="phone-4-Phone">Phone (Other)</label></td><td><input maxlength="32" size="20" name="phone-4-Phone" type="text" id="phone-4-Phone" class="form-text medium" /></td></tr><tr><td class="label"><label for="custom_9">Referral Source</label></td><td><input name="custom_9" type="text" value="" id="custom_9" class="form-text" /></td></tr><tr><td class="label"><label for="qf_69836b">  Gender
   <span class="marker">*</span>
</label></td><td><input value="1" type="radio" id="qf_d20fc1" name="gender" /><label for="qf_d20fc1">Female</label>&nbsp;<input value="2" type="radio" id="qf_5e7aa9" name="gender" /><label for="qf_5e7aa9">Male</label>&nbsp;<input value="3" type="radio" id="qf_57cbc6" name="gender" /><label for="qf_57cbc6">Transgender</label></td></tr></table><div class="crm-submit-buttons"><input class="form-submit default" name="_qf_Edit_next" value="Save" type="submit" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input class="form-submit default" name="_qf_Edit_cancel" value="Cancel" type="submit" /></div></fieldset>

</div>  
</form>
Last edited by jmilane on Tue Aug 08, 2006 4:22 pm, edited 4 times in total.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Id appreciate it if anyone could tell me about a PHP Form Generator that works. I have downloaded a few, but they are broken and dont work properly.
Ahh yes.

Everah and others are quite right considering the state of all the existing community Form Generator code you are better off doing it yourself. In a couple of weeks time I would refer you to OsisForms (my project, I'm sure all the regulars are sick of my raving about it by now :P) that specifically makes form creation really really accessible yet powerful and guess what, it works! or at least it will.....I hope :)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

looks ugly (use code and php tags plz)
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Post by jmilane »

The Ninja Space Goat wrote:looks ugly (use code and php tags plz)
I'll try.
Last edited by jmilane on Tue Aug 08, 2006 4:21 pm, edited 1 time in total.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

code and php tags.

do this

Code: Select all

blah
and this

Code: Select all

echo 'php!';
look a bit like this:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

jmilane wrote:I am using a Drupal module. It is a CRM module called CiviCRM.
....
Long and short of it is: is this even php code? Can I stick validation on this? Make it so I can control what happens after it is submitted?
You might want to try the Drupal forums for application specific help like that.
The Ninja Space Goat wrote::evil: Shaving Cream :x
I thought is was The Miniature Ninja Space Sheep about to attack from behind.
(#10850)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I thought it was what the sheep left behind ...Image
Post Reply