Jump to content

bigsilk

Members
  • Content Count

    104
  • Joined

  • Last visited

Community Reputation

0 Neutral

About bigsilk

  • Rank
    Member
  1. I got a good solution from someone at stackoverflow.com: var things = ['attorney', 'insurance', 'financial', 'estate', 'trust', 'death']; var guide = {t1: 'attorney', t2: 'insurance', t3: 'financial', t4: 'estate', t5: 'trust', t6: 'death'}; $('#t1, #t2, #t3, #t4, #t5, #t6').click(function() { var clicked = $(this).attr('id'); $.each(things, function(_, thing) { var $thing = $('#' + thing); if (guide[clicked] == thing) $thing.show(); else $thing.hide(); }); }); Amazing how one job can be accomplished in so many ways...
  2. Works fine in Safari. However, while the image is yellow, the combo box shows 'Black' on load.
  3. Am working on a site that requires replacing data in <div class="foo"> that has <div id="foo_1"> ... <div id="foo_6">, where these divs have different data.So, here's what I've got: $('#t1').click(function() { $('#attorney').show(); $('#insurance,#financial,#estate,#trust,#death').hide(); }); $('#t2').click(function() { $('#insurance').show(); $('#attorney,#financial,#estate,#trust,#death').hide(); }); $('#t3').click(function() { $('#financial').show(); $('#attorney,#insurance,#estate,#trust,#death').hide(); }); $('#t4').click(function() { $('#estate').show(); $('#attorney,#insurance,#financial,#trust,#death').hide(); }); $('#t5').click(function() { $('#trust').show(); $('#attorney,#insurance,#financial,#estate,#death').hide(); }); $('#t6').click(function() { $('#death').show(); $('#attorney,#insurance,#financial,#estate,#trust').hide(); }); Surely there's an easier way to do this, and I'm pretty sure switch/case is the answer. I just don't know how to write it. I'm learning this stuff on my own and W3schools, while a great resource, doesn't have much in the way of showing how to create switch/case with the click function.
  4. I concur entirely. Absolute positioning will eventually bite you in the turdpucker, especially in different browsers.Add:.contentbox { background-color: #4E412D; height: 50px; width: 200px; margin-top: 20px; float:left; }Ooh, look! I just became a member!
  5. I'm trying to get a reaction from a radio button choice: If a person chooses 'Single', nothing happens. If they choose 'Married', an input box appears to allow them to enter their spouse's name. <html><head><script type="text/javascript"> { document.getElementById("answer"); } if (value = married) { document.write("Spouse's Full Name: <input type="text" size="20">"); }</script></head><body><form>Your Marital Status: <input type="radio" name="answer" onclick="check(this.value)" value="single">Single<input type="radio" name="answer" onclick="check(this.value)" value="married">Married<br /></form></body></html>
  6. I'm using phphMyAdmin, and no, neither of those, yet. I'm really just getting into php and MySQL and am taking small, incremental steps towards creating a robust, safe db. As for display entries, couldn't I just:<?php$con = mysql_connect("localhost","peter","abc123");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con);$result = mysql_query("SELECT * FROM Persons");while($row = mysql_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br />"; }mysql_close($con);?> As for deletion, not all records were dups. It was 'appending' only a portion of the table, sometimes 80 records, sometimes 104. I would still have had to go into phpMyAdmin and make sure all bad things were gone.I do have a page that returns a record based on a username, though. I'm going to use that as the edit record page, eventually.
  7. I haven't created the UPDATE form, yet. Only a form to return a record associated with a username and a form to insert a new record. I'm trying to wrap my head around validation right now.I deleted the duplicate records. I'll keep trying to duplicate the error and see what I did to make it happen.Stay tuned...A
  8. I have a db that's supposed to have 236 records in it. For some odd reason, it suddenly has 634 and most of them are duplicates. It's as though the table is replicating itself and appending itself to the beginning of that table. I know it's the beginning because the first four hundred or so don't have the password included in any of the fields and it's not on my input form, yet. Here's my form to retrieve records from a query based on a username: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title>Edit Profile</title> <link href="CSS/profile.css" rel="stylesheet" type="text/css"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"></head><body><div class="centered_div"><div class="header">My Will Made Easy - Attorney Profile Editor</div><div class="profile_text"><?php$con = mysql_connect("localhost","###","###");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("bigsilkd_attorneys", $con);if (!empty($_POST['users'])){ $result = mysql_query('SELECT * FROM attorneys WHERE users=\'' . mysql_real_escape_string($_POST['users']) . '\'') or exit(mysql_error()); if ($row = mysql_fetch_assoc($result)) { ?>User Name: <input type="text" size="20" name="users" value="<?php echo $row['users']; ?>">Password: <input type="text" size="10" name="password" value="<?php echo $row['password']; ?>"> <br />Law Firm Name: <input type="text" size="60" name="LawFirmName" value="<?php echo $row['LawFirmName']; ?>"> <br />Main Office Address: <input type="text" size="60" name="MainOfficeAddress" value="<?php echo $row['MainOfficeAddress']; ?>"> <br />City: <input type="text" name="MainOfficeCity" value="<?php echo $row['MainOfficeCity']; ?>">ST: <input type="text" size="3" name="MainOfficeState" value="<?php echo $row['MainOfficeState']; ?>">Zip: <input type="text" size="10" name="MainOfficeZip" value="<?php echo $row['MainOfficeZip']; ?>"> <br />Main Phone: <input type="text" name="MainOfficePhone" value="<?php echo $row['MainOfficePhone']; ?>"> <br />Main Email Address: <input type="text" name="MainOfficeEmail" value="<?php echo $row['MainOfficeEmail']; ?>"> <br />Website Address: <input type="text" size="60" name="WebAddress" value="<?php echo $row['WebAddress']; ?>"> <br />Firm Overview: <textarea name='Overview' rows='5' cols='40'value="<?php echo $row['Overview']; ?>"></textarea><br />Years of Experience: <input type="text" name="YearsofExperience" value="<?php echo $row['YearsofExperience']; ?>"> <br />Languages Spoken: <textarea name='Languages' rows='5' cols='40'value="<?php echo $row['Languages']; ?>"></textarea><br />Geographical Areas Serving: <textarea name='GeographiesServing' rows='5' cols='40'value="<?php echo $row['GeographiesServing']; ?>"></textarea><br />Areas of Legal Practice: <textarea name='PracticeAreas' rows='5' cols='40'value="<?php echo $row['PracticeAreas']; ?>"></textarea><br />Primary Attorney's Name: <input type="text" name="MainAttorneyName" value="<?php echo $row['MainAttorneyName']; ?>"> <br />Primary Attorney's Phone Number: <input type="text" name="MainAttorneyPhone" value="<?php echo $row['MainAttorneyPhone']; ?>"> <br />Primary Attorney's Email Address: <input type="text" name="MainAttorneyEmail" value="<?php echo $row['MainAttorneyEmail']; ?>"> <br /> <?php } else { echo 'Username not found.'; ?><div class="profile_text"><form action="retrieve2.php" method="post"> User name: <input type="text" size="90" name="users" value="<?php echo $_POST['users']; ?>"></form> <?php }}else{ echo 'You must enter a user';}?></div></div></body></html> And here's what I'm using to input records: <?php$con = mysql_connect("localhost","###","###");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("bigsilkd_attorneys", $con);$sql="INSERT INTO attorneys (LawFirmName, MainOfficeAddress, MainOfficeCity, MainOfficeState, MainOfficeZip, MainOfficePhone, MainOfficeEmail, WebAddress, Overview, YearsofExperience, Languages, GeographiesServing, PracticeAreas, MainAttorneyName, MainAttorneyPhone, MainAttorneyEmail)VALUES('$_POST[LawFirmName]','$_POST[MainOfficeAddress]','$_POST[MainOfficeCity]','$_POST[MainOfficeState]','$_POST[MainOfficeZip]','$_POST[MainOfficePhone]','$_POST[MainOfficeEmail]','$_POST[WebAddress]','$_POST[Overview]','$_POST[YearsofExperience]','$_POST[Languages]','$_POST[GeographiesServing]','$_POST[PracticeAreas]','$_POST[MainAttorneyName]','$_POST[MainAttorneyPhone]','$_POST[MainAttorneyEmail]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?>
  9. First, go to:Visit This PageEnter 'user1' for the User name. Don't worry about the password. Hit the Search button.On the next page, notice how the labels for the <textarea> are located at the bottom-left of the boxes. I want them to be top-left.
  10. Odd (loosely used) that it would not work in 8. 6 I can dig. I use a separate CSS for 6. Are you using the developer tools (F12) in 8 and setting it to view in 7 plain and quirks mode?
  11. I've several <textarea> on a page, and they are aligned to the bottom-left of the text area. I want them aligned to the top-left.
  12. NO TABLES!Have you tried floating everything left? float:left;
  13. What version of IE are you using to view?
  14. Actually, it'sdb=bigsilkd_attorneystable=attorneyscolumn=usersIt works now...
×
×
  • Create New...