Hi. I wonder if someone can offer some small help here. Previously I have been using Chronoforms for joomla 1.0X. I now of course designed my website in joomla 1.5X, I tried to copy and paste the HTML code from the 'From Code' from old joomla to new joomla:
Here is the HTML code:
When I save it, it returns almost a blank page and nothing is saved.
I discovered that if I paste from:
into the 'Form Code' then it works. But I want to include the code below before the <table> tag.
What's the best way to include the above codes into the first part of the codes ie. before <table border="0" align="center" cellpadding="2" cellspacing="5" class="myForm">
Thanks
Here is the HTML code:
<style type="text/css">
<!--
.style_title {
font-size: 18px;
font-family: Verdana;
}
-->
</style>
<span class="style_title">Please Complete:</span><br />
<br />
<br />
</span>
<?php
global $database;
$query = "SELECT DISTINCT m.maid, m.make FROM #__ezautos_make AS m ORDER BY m.make";
$database->setQuery($query);
$makes = $database->loadObjectList();
//print_r($_REQUEST);
$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );
?>
<table border="0" align="center" cellpadding="2" cellspacing="5" class="myForm">
<tr>
<td valign="top"><strong> Your Details </strong></td>
<td> </td>
</tr>
<tr>
<td width="255" valign="top"><span class="style3">*</span> Title:</td>
<td width="251"><select name="Title" id="Title">
<option value="">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
</select>
<style>
.style3 {color: #FF0066}
.myForm td, input, select, textarea, checkbox {
font-family: tahoma;
font-size: 12px;
}
</style></td>
</tr>
<tr>
<td valign="top"><span class="style3">*</span> Name:</td>
<td><input name="Name" type="text" id="Name" size='30' maxlength='100' /></td>
</tr>
<tr>
<td valign="top"> Post Code:</td>
<td valign="middle"><input type="text" name="Post_Code" id="Post_Code" value="" size='15' maxlength='50' />
<SCRIPT LANGUAGE=JAVASCRIPT SRC="https://services.postcodeanywhere.co.uk/popups/javascript.aspx?account_code=flexi11121&license_key=wj92-fd17-tu26-nu99&branding=OFF"></SCRIPT></td>
</tr>
<tr>
<td valign="top"> Street Address:</td>
<td><input type="text" name="Street_Address" id="Street_Address" value="" size='30' maxlength='100' /></td>
</tr>
<tr>
<td valign="top"> City:</td>
<td><input type="text" name="City" id="City" value="" size='30' maxlength='100' /></td>
</tr>
<tr>
<td valign="top"> County:</td>
<td><input type="text" name="County" id="County" value="" size='30' maxlength='100' /></td>
</tr>
<tr>
<td valign="top"><span class="style3">*</span> Phone Number (no space):</td>
<td><input name="Phone" type="text" id="Phone" value="" size='30' maxlength='50' /></td>
</tr>
<tr>
<td valign="top"><span class="style3">*</span> Your email address:</td>
<td><input name="Email" type="text" id="Email" value="" size="30" maxlength="50" /></td>
</tr>
<tr>
<td valign="top"><strong> Vehicle Required </strong></td>
<td> </td>
</tr>
<tr>
<td valign="top"> Make:</td>
<td>
<?php
if($make_querystring != ""){
?>
<select name="Make" id="Make">
<option value="<?=$make_querystring?>"><?=$make_querystring?></option>
</select>
<?php
}
else{
?>
<select name="Make" id="Make" onchange="new_getModel()">
<option value="">Please Select ...</option>
<?php
foreach ($makes AS $make){
?>
<option value="<?=$make->make?>"><?=$make->make?></option>
<?php
}
?>
</select>
<?php
}
?>
</td>
</tr>
<tr>
<td valign="top"> Model:</td>
<td>
<div id="new_model_panel">
<?php
if($model_querystring != ""){
?>
<select name="Model" id="Model">
<option value="<?=$model_querystring?>"><?=$model_querystring?></option>
</select>
<?php
}
else{
?>
<select name="Model" id="Model">
<option value="">Please Select ...</option>
</select>
<?php
}
?>
</div>
</td>
</tr>
<tr>
<td valign="top"> Derivative</td>
<td>
<div id="derivative_panel">
<?php
if($derivative_querystring != ""){
?>
<select name="Derivative" id="Derivative">
<option value="<?=$derivative_querystring?>"><?=$derivative_querystring?></option>
</select>
<?php
}
else{
?>
<select name="Derivative" id="Derivative">
<option value="">Please Select ...</option>
</select>
<?php
}
?>
</div>
</td>
</tr>
<tr>
<td valign="top"> Specification:</td>
<td><input type="text" name="Specification" id="Specification" value="" size='30' maxlength='100' /></td>
</tr>
<tr>
<td valign="top"> Engine Size:</td>
<td><input type="text" name="Engine_Size" id="Engine_Size" value="" size='30' maxlength='50' /></td>
</tr>
<tr>
<td valign="top"> Preferred Contact Method:</td>
<td><select name="Contact_Method" id="Contact_Method">
<option value="">Please Select ...</option>
<option value="Email">Email</option>
<option value="Telephone">Telephone</option>
<option value="Fax">Fax</option>
<option value="Post">Post</option>
</select></td>
</tr>
<tr>
<td valign="top"><strong> Finance </strong></td>
<td> </td>
</tr>
<tr>
<td valign="top"> Purchase Preference:</td>
<td><select name="Purchase_Preference" id="Purchase_Preference">
<option value="">Please Select ...</option>
<option value="Contract Hire">Contract Hire</option>
<option value="Hire Purchase">Hire Purchase</option>
<option value="Personal Contract Plan">Personal Contract Plan</option>
<option value="Contract Purchase">Contract Purchase</option>
<option value="Outright Purchase">Outright Purchase</option>
<option value="Finance Lease">Finance Lease</option>
<option value="Lease Purchase">Lease Purchase</option>
</select></td>
</tr>
<tr>
<td valign="top"> Contract Length:</td>
<td><select name="Contract_Length" id="Contract_Length">
<option value="">Please Select ...</option>
<option value="12 Months">12 Months</option>
<option value="18 Months">18 Months</option>
<option value="2 Years" <?php if($year_querystring == 2) echo 'selected';?>>2 Years</option>
<option value="3 Years" <?php if($year_querystring == 3) echo 'selected';?>>3 Years</option>
<option value="4 Years" <?php if($year_querystring == 4) echo 'selected';?>>4 Years</option>
<option value="5 Years" <?php if($year_querystring == 5) echo 'selected';?>>5 Years</option>
</select></td>
</tr>
<tr>
<td valign="top"> Miles Per Annum:</td>
<td><input type="text" name="Mileage" id="Mileage" value="" size='30' maxlength='50' /></td>
</tr>
<tr>
<td valign="top"> Maintenance:</td>
<td><select name="Maintenance" id="Maintenance">
<option value="">Please Select ...</option>
<option value="With Maintenance">With Maintenance</option>
<option value="Without Maintenance">Without Maintenance</option>
<option value="Quote me for both">Quote me for both</option>
</select></td>
</tr>
<tr>
<td valign="top"> Personal/ Business:</td>
<td><label for="CustomFields[20_1]_Personal">
<input type="radio" name="Personal_Business" id="Type_Personal" value="Personal" />
Personal</label>
<label for="CustomFields[20_1]_Business">
<input name="Personal_Business" type="radio" id="Type_Business" value="Business" />
Business</label>
<label for="CustomFields[20_1]_Business"></label></td>
</tr>
<tr>
<td valign="top"> Further Requests:</td>
<td><textarea name="Further_Requests" id="Further_Requests" rows='3' cols='30'></textarea></td>
</tr>
<input type="hidden" name="format" value="h" />
<tr>
<td></td>
<td><input name="Submit" type="submit" id="Submit" value="Submit" />
<input name="Reset" type="reset" id="Reset" value="Reset" /></td>
</tr>
<tr>
<td colspan="2"><span class="style3">*</span> Field Required</td>
</tr>
</table>When I save it, it returns almost a blank page and nothing is saved.
I discovered that if I paste from:
<table border="0" align="center" cellpadding="2" cellspacing="5" class="myForm">
<tr>
<td valign="top"><strong> Your Details </strong></td>
<td> </td>
</tr>
<tr>
<td width="255" valign="top"><span class="style3">*</span> Title:</td>
<td width="251"><select name="Title" id="Title">
<option value="">Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
</select>
into the 'Form Code' then it works. But I want to include the code below before the <table> tag.
<style type="text/css">
<!--
.style_title {
font-size: 18px;
font-family: Verdana;
}
-->
</style>
<span class="style_title">Please Complete:</span><br />
<br />
<br />
</span>
<?php
global $database;
$query = "SELECT DISTINCT m.maid, m.make FROM #__ezautos_make AS m ORDER BY m.make";
$database->setQuery($query);
$makes = $database->loadObjectList();
//print_r($_REQUEST);
$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );
?>
What's the best way to include the above codes into the first part of the codes ie. before <table border="0" align="center" cellpadding="2" cellspacing="5" class="myForm">
Thanks
Hi pkong,
Put the CSS snippets like this one:
Add this line after the first <?php tag
Update the old Joomla! 1.0 mos. . . methods to the Joomla! 1.5 equivalents (there are some updating guides on the Joomla! docs site I think).
That should get the form to a stage where you can debug the rest.
Bob
Put the CSS snippets like this one:
.style_title {
font-size: 18px;
font-family: Verdana;
}into the Form CSS box (and delete the style tags)Add this line after the first <?php tag
if ( !$mainframe->isSite() ) { return; }Update the old Joomla! 1.0 mos. . . methods to the Joomla! 1.5 equivalents (there are some updating guides on the Joomla! docs site I think).
That should get the form to a stage where you can debug the rest.
Bob
Do you mean:
It did not work. It returns a blank page
<?php
if ( !$mainframe->isSite() ) { return; }
global $database;
$query = "SELECT DISTINCT m.maid, m.make FROM #__ezautos_make AS m ORDER BY m.make";
$database->setQuery($query);
$makes = $database->loadObjectList();
//print_r($_REQUEST);
$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );
?>
It did not work. It returns a blank page
Hi. I entered
but I get a blank page ie.
http://cocoonvehicles.co.uk/new/index.php?option=com_chronocontact&chronoformname=Request_a_Quote
<span class="style_title">Please Complete:</span><br />
<?php
if ( !$mainframe->isSite() ) { return; }
global $database;
$query = "SELECT DISTINCT m.maid, m.make FROM #__ezautos_make AS m ORDER BY m.make";
$database->setQuery($query);
$makes = $database->loadObjectList();
//print_r($_REQUEST);
$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );
?>
<table border="0" align="center" cellpadding="2" cellspacing="5" class="myForm">
<tr>
<td valign="top"><strong> Your Details </strong></td>
<td> </td>
</tr>
<tr>
but I get a blank page ie.
http://cocoonvehicles.co.uk/new/index.php?option=com_chronocontact&chronoformname=Request_a_Quote
Hi pkong,
Sure but you still haven't upgraded your PHP to Joomla! 1.5. The basic database syntax is now
Bob
Sure but you still haven't upgraded your PHP to Joomla! 1.5. The basic database syntax is now
$db =& JFactory::getDBO();
$query = "
SELECT ``
FROM `#__`
WHERE `` = '' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
//$data = $db->loadResult();And not much of this will work any more$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );as the mos. . . methods are no longer supported.Bob
Hi! Can you help as I have zero knowledge in php programming.
and can you help to rewrite the code so that joomla 1.5 understands it. Many thanks
<?php
global $database;
$query = "SELECT DISTINCT m.maid, m.make FROM #__ezautos_make AS m ORDER BY m.make";
$database->setQuery($query);
$makes = $database->loadObjectList();
//print_r($_REQUEST);
$make_querystring = mosGetParam( $_REQUEST, 'make', '' );
$model_querystring = mosGetParam( $_REQUEST, 'model', '' );
$derivative_querystring = mosGetParam( $_REQUEST, 'derivative', '' );
$year_querystring = mosGetParam( $_REQUEST, 'year', '' );
?>
and can you help to rewrite the code so that joomla 1.5 understands it. Many thanks
This topic is locked and no more replies can be posted.
