Jump to content

vijdev

Members
  • Posts

    109
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vijdev's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. i have a problem wth the area in processData() area below. what my code does is... 1. takes input via form 2.gets success from a post 3.displays latest form input that was submitted to the server DB 4. asks for add another 5. as you add another, it goes on appending all recent adds to server (processData()) to show as a cue problem: first add is ok second add, appends the input twice. 3rd add appends the input thrice..etc... and so on. but it must be once only! <!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> <title>Manager</title> <link rel="stylesheet" type="text/css" href="../css/style.css"/> <script type="text/javascript" src="../scripts/jquery-1.4.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ var g_ID=$('#in').val(); $('#div_add').hide(); $('#res').hide(); $('#recent').hide(); $('#action2').hide(); $('#action3').hide(); $('#fail').hide(); $('#errorlist').hide(); $('#action1,#action2').click( function(){ $('#action1,#action2,action3').hide(); $('#fail').hide(); $('#errorlist').hide(); $('#in').val(''); $('#div_add').show(); $('#in').focus(); $('#res').hide(); $('#recent').hide(); $('#form_add').submit( function(){ var formData = $(this).serialize(); $.post('baseload.php',formData,processData); function processData(data) { if (data==' Added!') { if (!$('#result').length) { $('#res').prepend('<span id="result">... Added!!</span>'); } if (!$('#rec').length) { [color=red]$('#recent').append("<span id='rec'> Added: "); $('#rec').append(g_ID); $('#recent').append("</span>"); } else{ $('#rec').append(","); $('#rec').append(g_ID); $('#rec').append("."); }[/color] $('#errorlist').hide(); $('#res').show(); $('#recent').show(); $('#div_add').hide(); $('#action1').hide(); $('#action2').show(); $('#action3').show(); $('#fail').hide(); return false; } else { if (! $('#fail').length) { $('#div_add').prepend('<span id="fail">Incorrect information. Please try again</span>'); return false; } }return false; } //end not empty-redundant brkt return false;}//end submit function )//end submit }//end click function ) //end click action1,action2 var url='home.php'; $('#action3,#action4').click( function() { location.reload(); } ); }//end doc ready func{} );//end ready() </script> </head> <body> <a href="#div_add" class="common" id="action1" title="Add an " accesskey="a">Add !</a> <div id="div_add" title="Add !"> <form action="baseload.php" id="form_add" name="form_add" method="post" title="Add to DB"> <input type="text" id="in" maxlength="200" size="70" title=" In" name="base" /> <input type="submit" name="b_info" value="Check-In!" id="b_info" /> <button class="common" id="action4" title="Home" accesskey="h">Cancel!</button> <span id="errorlist" class="errors"></span> </form> <br /> </div> <div id="res"> <br /> <button class="common" id="action2" title="Add another " accesskey="a">Add Another </button> <button class="common" id="action3" title="Home" accesskey="h">Am Done for now!</button> </div> <div id="recent" class="recent"> </div> </body> </html>
  2. thank you friends...finally figured out it was a problem with my parser in the IDE..it was set to parse php in CSS, and was reading css as html/plain...
  3. I have pasted the CSS in my first post above. Here's a status update - I have uninstalled all extensions, reinstalled both browsers, turned off mcafee firewall.. Still the same problem!!!!It is only with linked CSS, and only with chrom and firefox, not with IE linked CSS.. @WTFranklin - i understand what you mean but am quite unwilling to let go of the versatility, and not convinced why!!!!
  4. html: <!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> <title>Manager</title> <link href="../css/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="div_add" title="Add!" class="errors"> <form action="load.php" id="form_add" name="form_add" method="post" title="Add to DB"> <input type="text" id="in" maxlength="200" size="70" title="In" name="base" /> <input type="submit" name="b_info" value="Check-In!" id="b_info" /> </form> </div> </body> </html> css: .errors{ border-style: dashed; }
  5. i would still like to see: mysite.fr/articles/name_of_the_article instead of: mysite.fr/articles.php?name=name_of_the_article or mysite.fr/articles.php?num=9 or view.php?name=blabla (from db point of view basically article id number will have an article title linked to it in the same row...) can anyone help? RAD!S solution "works", but not what am looking for!
  6. 1. Can someone point me to a good explanation resource on DNS? 2. what is the difference between changing this DNS info in my hosting interface Vs. my domain name registrar interface..or is there something am missing?
  7. the thing is am still a sub-novice at jquery or any ajaxy things.. so was wondering abt iframes... i know ajax is the ultimate final destination. any alternatives until then?..why do you say NO to iframes?..is it so dangerous and messy? and if not ajax and if not iframes..anything else?
  8. can i use iframe to display a php form, and when it is submitted, only the iframe portion has to fetch the new thank you page, and the overall page is not refreshed. is this a good idea?
  9. thanks.ok, let me try that...out! how abt preventing an e-mail being sent? do you think setting field for "email_sent" as yes/no and sending only if "no"..is a good way?
  10. "BACK" or REFRESH: Preventing database interaction / code execution how to prevent database interaction / code execution when user presses back or refresh button? can i detect? can i disable back/refresh?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.