1,076,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by vishalonne which have been Voted Up

Got the answer thank youdeception for guidance I used cin.ignore()

vishalonne
Junior Poster
188 posts since Jun 2009
Reputation Points: 22
Solved Threads: 0
Skill Endorsements: 0

Is this code okay as you suggested

<?php

$filename = 'hitcount.txt';
$handle = fopen($filename, 'r');
$hits = trim(fgets($handle)) + 1;
fclose($handle);

$handle = fopen($filename, 'w');
fwrite($handle, $hits);
fclose($handle);

// Uncomment the next line (remove //) to display the number of hits on your page.
//echo $hits;

?>

And at the end of my form.php page I will add this

<p>This web site has had <b><?php include("counter.php"); ?></b> hits since January 1st, 2007.</p>

vishalonne
Junior Poster
188 posts since Jun 2009
Reputation Points: 22
Solved Threads: 0
Skill Endorsements: 0

Hi

My problem is that I want Other textbox tobe deactivated when page loads, but when user selects Other drop down box of Company Certification: then Other textbox should be activated.

Please see here

Here is the PHP code which is displaying this page

<?php
		echo "<select name=\"company_certification\">";
			echo "<option value=\"ISO2001\">ISO2001</option>";
			echo "<option value=\"OTHER\">Other</option>";
			echo "<option value=\"None\">None</option>";
		echo "</select>";
?>

<?php echo "Other:"; ?>
	<?php echo zen_draw_input_field('other_certification', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'customer_company_other_certification', '40') . ' id="other_certification"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?>

And I found a java script which is this

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<script type="text/javascript">

function change(val)
{	
	if (val=="Other")
		{
			document.getElementById("txt").innerHTML="<input type=\"text\" id=\"other\" name=\"other\"/>";
		}
		else
		{
			document.getElementById("txt").innerHTML="<input type=\"text\" id=\"other\" name=\"other\" disabled/>";
		}
}
</script>
</head>

<body>

<form name="f1">

<select name="s1" onchange="change(this.value)" onchange="change(this.value)">
<option value="ISO2000">ISO2000</option>
<option value="ISI">ISI</option>
<option value="Other">Other</option>
</select>

<div id="txt">
	<input type="text" id="other" name="other"  disabled/>
</div>


</form>

</body>
</html>

Can I use this java script in my php code mentioned above.

Please help me...

Thank you all in advance

vishalonne
Junior Poster
188 posts since Jun 2009
Reputation Points: 22
Solved Threads: 0
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.0599 seconds using 2.49MB