Jump to content

HensterRSA

Members
  • Posts

    18
  • Joined

  • Last visited

HensterRSA's Achievements

Newbie

Newbie (1/7)

1

Reputation

  1. hi I used to be abel to add a sub topic inside the list.... been searching on the net but i cannot find itcan some one help me <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option></select>
  2. found it thanks <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <body><script> function alertTotal() { var aSelect = document.getElementById('a'); var bSelect = document.getElementById('b'); var cSelect = document.getElementById('c'); var aValue = aSelect.options[aSelect.selectedIndex].value; var bValue = bSelect.options[bSelect.selectedIndex].value; var cValue = cSelect.options[cSelect.selectedIndex].value; //alert(parseInt(aValue) + parseInt(bValue) + parseInt(cValue)); total.innerHTML=parseInt(aValue) + parseInt(bValue) + parseInt(cValue); }</script>CPU #######:<select id="a" onchange="alertTotal();"><option value="0">Not selected</option> <option value="3500">I7 R3500.00</option> <option value="2500">I5 R2500.00</option> <option value="1500">I3 R1500</option> </select><br>Mother Board :<select id="b" width="230" STYLE="width: 430px" size="0" onchange="alertTotal();"><option value="0">Not selected</option> <option value="363">Intel Houlton D2500 Mini-ITX - Supports 2 x DDR3 (Max 4GB). Up to 8 USB 2.0 Ports, 2 x SATA, 1 x Parallel Port, 2 x Serial Ports (via Header) 1 x D-Sub, 1 x Conventional PCI Slot, 10/100/1000 LAN</option> <option value="2">2</option> <option value="3">3</option> </select><br>RAM:#######<select id="c" onchange="alertTotal();"> <option value="0">Not selected</option> <option value="100">2GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="190">4GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="250">4GB DDR3 1333, 240-Pin Memory Module - Kingston </option> </select><br><br><br><br><div>Total: R<span id="total">0</span></div><!-- <button onclick="alertTotal();">Show Total</button> --></body>
  3. <div>Price: R<span id="currentTotal"></span></div> added this as welll aslo not showing the price
  4. } onchange="alertTotal()" ;}</script>i added this and it's not updating
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <body><script> function alertTotal() { var aSelect = document.getElementById('a'); var bSelect = document.getElementById('b'); var cSelect = document.getElementById('c'); var aValue = aSelect.options[aSelect.selectedIndex].value; var bValue = bSelect.options[bSelect.selectedIndex].value; var cValue = cSelect.options[cSelect.selectedIndex].value; alert(parseInt(aValue) + parseInt(bValue) + parseInt(cValue)); }</script>CPU #######:<select id="a"><option value="0">Not selected</option> <option value="3500">I7 R3500.00</option> <option value="2500">I5 R2500.00</option> <option value="1500">I3 R1500</option> </select><br>Mother Board :<select id="b" width="230" STYLE="width: 430px" size="0"><option value="0">Not selected</option> <option value="363">Intel Houlton D2500 Mini-ITX - Supports 2 x DDR3 (Max 4GB). Up to 8 USB 2.0 Ports, 2 x SATA, 1 x Parallel Port, 2 x Serial Ports (via Header) 1 x D-Sub, 1 x Conventional PCI Slot, 10/100/1000 LAN</option> <option value="2">2</option> <option value="3">3</option> </select><br>RAM:#######<select id="c"><option value="0">Not selected</option> <option value="100">2GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="190">4GB DDR3 1333, 240-Pin Memory Module - PATRIOT</option> <option value="250">4GB DDR3 1333, 240-Pin Memory Module - Kingston </option> </select><br><br><br><br><button onclick="alertTotal();">Show Total</button> </body> When i click the total works fine but when i add the scritp to show the total i get nothing , i don't want to click to see the total Price: R<span id="alertTotal();"></span>
  6. ok i have done this in html <td><input type="checkbox" name="series" id="series[]" value="blue" /> </td><td><input type="checkbox" name="series" id="series[]" value="red" /> </td> in my submit.php on top $var = $_POST['series']; foreach($_POST['check'] as $value) {$check_msg .= "Checked: $value\n";} in my submit.php below $msg='Name: '.$_POST['name'].'<br />Email: '.$_POST['email'].'<br />IP: '.$_SERVER['REMOTE_ADDR'].'<br /><br />Series Selected : '.$_POST['series'].'<br /> Message:<br /><br /> only one clour shows when i select 2
  7. fom a previus post .. im also lost kinldy give me the correct coding .. basically i have multible check boxes and only want the selected ones to send to email everything ells works
  8. <input type="checkbox" name="series" id="series" value="series ” /><?=$_POST['value'][0]?>and<input type="checkbox" name="blue" value="blue"><?=$_POST['value'][0]?>
  9. hi can you please write it out for me .. kinda a bit lost...
  10. ok this is wrong i should change this : if($_POST['consultancy']==1) { $msg.='Consultancy: '.$_POST['consultancy']; }
  11. yippy i selected series and i got it on my mail ... Here is the big one question I need to add about 640 check boxes with diffrent values , how am i going to do that ?
  12. hi im a big noob ,,, lol maybe one day i will get this ok i placed this in my codey on the index.php <tr> <td><label for="series">series</label></td> <td><input type="checkbox" name="series" id="series" value="series ” /><?=$_POST['value'][0]?> </td> <td valign="top"> </td> <tr> <td> <label FOR="blue">blue</label></td> <td> <input type="checkbox" name="check[]" value="blue"><?=$_POST['value'][0]?> </td></tr>and this in my send.php$msg='Name: '.$_POST['name'].'<br />Email: '.$_POST['email'].'<br />IP: '.$_SERVER['REMOTE_ADDR'].'<br /><br />Series Selected : '.$_POST['value'].'<br /> but when i select them i get an empty result for the tick boxes
  13. i went wrong here Series Selected : '.$_POST['value'].'<br /> but have no clue how to fix it
  14. please help I know it's something silly , i cannot get the selecter checkboxes to send to the mail index.php <?phpsession_name("fancyform");session_start();$_SESSION['n1'] = rand(1,20);$_SESSION['n2'] = rand(1,20);$_SESSION['expect'] = $_SESSION['n1']+$_SESSION['n2'];$str='';if($_SESSION['errStr']){ $str='<div class="error">'.$_SESSION['errStr'].'</div>'; unset($_SESSION['errStr']);}$success='';if($_SESSION['sent']){ $success='<h1>Thank you!</h1>'; $css='<style type="text/css">#contact-form{display:none;}</style>'; unset($_SESSION['sent']);}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Henster Feedback Form </title><link rel="stylesheet" type="text/css" href="jqtransformplugin/jqtransform.css" /><link rel="stylesheet" type="text/css" href="formValidator/validationEngine.jquery.css" /><link rel="stylesheet" type="text/css" href="demo.css" /><?=$css?><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script><script type="text/javascript" src="jqtransformplugin/jquery.jqtransform.js"></script><script type="text/javascript" src="formValidator/jquery.validationEngine.js"></script><script type="text/javascript" src="script.js"></script></head><body><div id="main-container"> <div id="form-container"> <h1>Hensters Feedback Form</h1><br><br> <h2>Drop us a line and we will get back to you</h2> <form id="contact-form" name="contact-form" method="post" action="submit.php"> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td width="15%"><label for="name"><Name</label></td> <td width="70%"><input type="text" class="validate[required,custom[onlyLetter]]" name="name" id="name" value="<?=$_SESSION['post']['name']?>" /></td> <td width="15%" id="errOffset"> </td> </tr> <tr> <td><label for="email">Email</label></td> <td><input type="text" class="validate[required,custom[email]]" name="email" id="email" value="<?=$_SESSION['post']['email']?>" /></td> <td> </td> </tr> <tr> <td><label for="subject">Subject</label></td> <td><select name="subject" id="subject"> <option value="" selected="selected"> - Choose -</option> <option value="Question">Question</option> <option value="Business proposal">Business proposal</option> <option value="Advertisement">Advertising</option> <option value="Complaint">Complaint</option> </select> </td> <td> </td> </tr> <tr> <td valign="top"><label for="message">Message</label></td> <td><textarea name="message" id="message" class="validate[required]" cols="35" rows="5"><?=$_SESSION['post']['message']?></textarea></td> <td valign="top"> </td> </tr> <tr> <td><label for="series">series</label></td> <td><input type="checkbox" name="series" id="series" value="series ” /><?=$_SESSION['post']['value']?> </td> <td valign="top"> </td> <tr> <td> <label FOR="blue">blue</label></td> <td> <input type="checkbox" name="check[]" value="blue"><?=$_SESSION['post']['value']?></td></tr><br> <h2>Select the Series </h2> <tr> <td><label for="captcha"><?=$_SESSION['n1']?> + <?=$_SESSION['n2']?> =</label></td> <td><input type="text" class="validate[required,custom[onlyNumber]]" name="captcha" id="captcha" /></td> <td valign="top"> </td> </tr> <tr> <td valign="top"> </td> <td colspan="2"><input type="submit" name="button" id="button" value="Submit" /> <input type="reset" name="button2" id="button2" value="Reset" /> </tr> <?=$str?> <img id="loading" src="img/ajax-load.gif" width="16" height="16" alt="loading" /></td> </tr> </table> </form> <?=$success?> </div> <div class="tutorial-info"> This is a Henster Feedback Page</div></body></html> and my submit.php ?php/* config start */$emailAddress = 'info@henster.co.za';/* config end */require "phpmailer/class.phpmailer.php";session_name("fancyform");session_start();foreach($_POST['check'] as $value) {$check_msg .= "Checked: $value\n";}foreach($_POST as $k=>$v){ if(ini_get('magic_quotes_gpc')) $_POST[$k]=stripslashes($_POST[$k]); $_POST[$k]=htmlspecialchars(strip_tags($_POST[$k]));}$err = array();if(!checkLen('name')) $err[]='The name field is too short or empty!';if(!checkLen('email')) $err[]='The email field is too short or empty!';else if(!checkEmail($_POST['email'])) $err[]='Your email is not valid!';if(!checkLen('subject')) $err[]='You have not selected a subject!';if(!checkLen('message')) $err[]='The message field is too short or empty!';if((int)$_POST['captcha'] != $_SESSION['expect']) $err[]='The captcha code is wrong!';if(count($err)){ if($_POST['ajax']) { echo '-1'; } else if($_SERVER['HTTP_REFERER']) { $_SESSION['errStr'] = implode('<br />',$err); $_SESSION['post']=$_POST; header('Location: '.$_SERVER['HTTP_REFERER']); } exit;}$msg='Name: '.$_POST['name'].'<br />Email: '.$_POST['email'].'<br />IP: '.$_SERVER['REMOTE_ADDR'].'<br /><br />Series Selected : '.$_POST['value'].'<br />Message:<br /><br />'.nl2br($_POST['message']).'';if($_POST['consultancy']==1) { $msg.='Consultancy: '.$_POST['consultancy']; }$mail = new PHPMailer();$mail->IsMail();$mail->AddReplyTo($_POST['email'], $_POST['name']);$mail->AddAddress($emailAddress);$mail->SetFrom($_POST['email'], $_POST['name']);$mail->Subject = "A new ".mb_strtolower($_POST['subject'])." from ".$_POST['name']." | contact form feedback";$mail->MsgHTML($msg);$mail->Send();unset($_SESSION['post']);if($_POST['ajax']){ echo '1';}else{ $_SESSION['sent']=1; if($_SERVER['HTTP_REFERER']) header('Location: '.$_SERVER['HTTP_REFERER']); exit;}function checkLen($str,$len=2){ return isset($_POST[$str]) && mb_strlen(strip_tags($_POST[$str]),"utf-8") > $len;}function checkEmail($str){ return preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $str);}?>
×
×
  • Create New...