?
Solved

uncheck button in php form

Posted on 2011-04-18
4
Medium Priority
?
274 Views
Last Modified: 2012-05-11
Hi There,
I Have some php and I would like to change it so that the check boxes are not checked by default?

This is the script here and you can see the page here

http://www.maxtemp.com.au/index.php?page=checkout.index&option=com_virtuemart&Itemid=100001&redirected=1&Itemid=100001

use snowball77
test1234
to login and test.

Thank you

<?php

if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

/**

*

* @version $Id: list_shipto_addresses.tpl.php 1725 2009-04-21 09:10:34Z soeren_nb $

* @package VirtueMart

* @subpackage templates

* @copyright Copyright (C) 2007-2009 Soeren Eberhardt. All rights reserved.

* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php

* VirtueMart is free software. This version may have been modified pursuant

* to the GNU General Public License, and as distributed it includes or

* is derivative of works licensed under the GNU General Public License or

* other free or open source software licenses.

* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.

*

* http://virtuemart.net

*/



?>

<table border="0" width="100%" cellpadding="2" cellspacing="0">

	<tr class="sectiontableentry1">

		<td>

		<?php

		$checked = '';

		if( $bt_user_info_id == $value || empty($value)) {

			$checked = 'checked="checked" ';

		}

		echo '<input type="radio" name="'.$name.'" id="'.$bt_user_info_id.'" value="'.$bt_user_info_id.'" '.$checked.'/>'."\n";

	

		?></td>

		<td><label for="<?php echo $bt_user_info_id ?>"><?php echo $VM_LANG->_('PHPSHOP_ACC_BILL_DEF') ?></label></td>

	</tr>

<?php

$i = 2;

while($db->next_record()) {

	echo '<tr class="sectiontableentry'.$i.'">'."\n";

	echo '<td width="5%">'."\n";

	$checked = '';

	if ( $value == $db->f("user_info_id")) {

		$checked = 'checked="checked" ';

	}

	echo '<input type="radio" name="'.$name.'" id="' . $db->f("user_info_id") . '" value="' . $db->f("user_info_id") . '" '.$checked.' />'."\n";

	

	echo '</td>'."\n";

	echo '<td>'."\n";

	echo '<label for="'.$db->f("user_info_id") . '">';

			

	echo '<strong>' . $db->f("address_type_name") . "</strong> ";

	$url = SECUREURL . "index.php?page=account.shipto&user_info_id=" . $db->f('user_info_id')."&next_page=checkout.index";

	echo '(<a href="'.$sess->url($url).'">'.$VM_LANG->_('PHPSHOP_UDATE_ADDRESS').'</a>)'."\n";

	echo '<br />'."\n";

	echo $db->f("title") . " ". $db->f("first_name") . " ". $db->f("middle_name") . " ". $db->f("last_name") . "\n";

	echo '<br />'."\n";

	if ($db->f("company")) {

		echo $db->f("company") . "<br />\n";

	}

	echo $db->f("address_1") . "\n";

	if ($db->f("address_2")) {

		echo '<br />'. $db->f("address_2"). "\n";

	}

	echo '<br />'."\n";

	echo $db->f("city");

	echo ', ';

	// for state, can be used: state_name, state_2_code, state_3_code

	echo $db->f("state_2_code") . " ";

	echo $db->f("zip") . "<br />\n";

	// for country, can be used: country_name, country_2_code, country_3_code

	// (not displayed in default template)

	echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_PHONE').': '. $db->f("phone_1") . "\n";

	echo '<br />'."\n";

	echo $VM_LANG->_('PHPSHOP_CHECKOUT_CONF_FAX').': '.$db->f("fax") . "\n";

	echo '</label>

	</td>

	</tr>'."\n";

	if($i == 1) $i++;

	elseif($i == 2) $i--;

}

?>

</table>

Open in new window

0
Comment
Question by:Amanda Watson
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Greg Alexander earned 2000 total points
ID: 35419770
Take out lines 49 - 53:

if( $bt_user_info_id == $value || empty($value)) {

   $checked = 'checked="checked" ';

}
0
 
LVL 11

Author Comment

by:Amanda Watson
ID: 35419890
that worked thanks
0
 
LVL 11

Author Closing Comment

by:Amanda Watson
ID: 35419892
ta
0
 
LVL 19

Expert Comment

by:Greg Alexander
ID: 35419896
NP, thanks for the points!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question