I’ve got a form I’ve written in PHP.
I’ve got one submit button that changes text that’s inputted into a textfield.
What I need is to have a few more buttons.
When the other buttons are clicked, the textfiels will get formatted ina slightly different way.
I’m scratching ym head since I can’t figure out how I could have more than one button attach to a form.
Stupid question: is this a Javascript or other client side language problem as opposed to a PHP one?
I can’t make my mind up. ?
The code I have so far is:
[code=php]<html><title></title>
<link href=”myCSS.css” rel=”stylesheet” type=”text/css”>
<body>
<?php
IF (isset($_POST[“address”]))
{
$addressString = strtolower($_POST[“address”]);
if(get_magic_quotes_gpc())
{
$addressString = stripslashes($addressString);
}
$addressString = str_replace(“n”, “,”, $addressString);
$myArray = explode(“,”, $addressString);
$numberOfArrayItems = count($myArray);
$myArray[$numberOfArrayItems – 1] = strtoupper($myArray[$numberOfArrayItems – 1]);
$newCorrectFormatAddress = “”;
for ($i=0; $i<=$numberOfArrayItems; $i++)
{
$myArray[$i] = ucwords($myArray[$i]);
$myArray[$i] = trim($myArray[$i]);
$newCorrectFormatAddress = $newCorrectFormatAddress . $myArray[$i] . “n”;
}
$newCorrectFormatAddress = trim($newCorrectFormatAddress);
$onfocus = “”;
}
ELSE
{
$newCorrectFormatAddress = “Please enter your address”;
$onfocus = “onfocus=’form.address.value=””‘”;
}
?>
<br>
<form action=”index.php” method=”post” name=”addressFixer”>
<textarea name=”address” cols=”40″ rows=”6″ class=”blueText” <?php print $onfocus; ?>><?php echo $newCorrectFormatAddress; ?></textarea>
<br>
<br>
<label>
<input type=”submit” name=”Submit” value=”Submit”>
</label>
</form>
</html>