Jump to content

BeeDev

Member
  • Posts

    328
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by BeeDev

  1. http://code.google.com/p/ie7-js/ This may help you even if little bit. it's a javascript library developed by Dean Edwards I haven't used it in Production before, but apparantly it makes IE5 and IE6 behave like a standards compliant browser, and it corrects Transparent PNGs, fixes a lot of Javascript & CSS issues associated with the browsers. Note: Use conditional comments to load this JS only on lower than IE8.
  2. BeeDev

    Feedback Form

    Too many parameters passed to mail() function. Parameters are separated by comma, however you got like 7 parameters in there.
  3. BeeDev

    Create database

    <?php $dbHost = "localhost"; $username = "mySqlUsername"; $password = "myPassword"; $query = "CREATE DATABASE myDatabaseName"; $con = mysql_connect($dbHost,$username,$password); if (!$con) { die('Could not connect: ' . mysql_error()); } if (mysql_query($query,$con)) { echo "Database created"; } else { echo "Error creating database: " . mysql_error(); } mysql_close($con); ?>
  4. If you still haven't figured out your problem : Inline styles for the win Apply jqTransform to both forms, then use jQuery to style those textboxes as soon as jqTransform finishes doing it's job. $(function(){ // jqTransform called here // change the search box width using custom width var $searchWidth = "100px"; $("form[name=jqsearch] div.jqTransformInputWrapper").css("width",$searchWidth); // change the quantity box width using custom width var $addItemWidth = "30px"; $("form[name=addItem] div.jqTransformInputWrapper").css("width",$addItemWidth); });
  5. Just an idea, but have u tried using a transparent PNG for ur background? And you can apply IE Png Fix to that background maybe ...
  6. You can see that when jqTransform is called, the actual form boxes are hidden and instead, there's replacement items created by jqTransform. you can target this class by CSS to style the textbox width in both FF and IE: div.jqTransformSelectWrapper { width: ; } and text: div.jqTransformInputWrapper
  7. I checked your page. When You're calling the script: $(function(){ $('form').jqTransform({imgPath:'jqtransformplugin/img/'}); }); You're applying jqTransform to ALL the forms on that page. But you can target specific forms using: $(function(){ $('form[name=myFormName]').jqTransform({imgPath:'jqtransformplugin/img/'}); }); Also that demo page hasn't set a width to the text boxes (in the CSS), or a length property on the input. So Firefox and IE assume different lengths. If you do: and using CSS you can style the class "textbox" Then i'm assuming the widths will be consisten on browsers.
  8. http://www.dfc-e.com/metiers/multimedia/opensource/jqtransform/
  9. Yes I understand what that line does. And I know IE Debugger can be as good as IE itself - shite. FireBug is the best javascript debugger Can't you name your answer & question arrays with the dice numbers, and then put them all in one script file? For example: question11 question51 question12... etc And you can include them in your script like so: var q1 = eval('question'+d1+d2+'[0]'); var a1 = eval('answer'+d1+d2+'[0]'); var a2 = eval('answer'+d1+d2+'[1]'); var a3 = eval('answer'+d1+d2+'[2]'); var a4 = eval('answer'+d1+d2+'[3]'); like you've already done so in some parts of your script. Also you can also consolidate all your arrays into one. Your basic structure is: question, 4 possible answers, correct answer. So you structure arrays like so: var quiz11 = new Array(); quiz11[0] = new Array(2); quiz11[0][0] = "Which of the following statements is NOT TRUE about the text within a Plan?"; quiz11[0][1] = "Words are useful as well as pictures.*A Plan is not complete without explanatory text and justification.*Constraints within the Plan should be documented.*Narrative text is always waffle.*d"; quiz11[1] = new Array(2); quiz11[1][0] = ..... quiz11[1][1] = ..... You see above I put the question into the first part of the two dimension array. The second part has ALL the answers AND the correct answer in the end, separated by an asterisk * When you're reading the answers, you can just separate them using the asterisk: var temp = quiz11[0][1]; var tempArray = new Array(); tempArray = temp.split("*"); So after that process, tempArray will have all your answers, as well as the correct answer. tempArray[0] has the first possible answer, tempArray[1] has the next one and so on. tempArray[4] will have the correct answer information. You can improve even further by declaring your quiz11 and quiz12 quiz13 .... quiz66 arrays using a loop. More info on string.split here: http://www.tizag.com/javascriptT/javascript-string-split.php More info on multi-dimensional arrays here: http://www.exforsys.com/tutorials/javascript/javascript-two-dimensional-arrays.html Good luck.
  10. I just copied your HTML and 11.js into my local computer and ran the page. The page generated the numbers and put the question in there, however my debugger showed one javascript error: document.scripts is not a function which is referring to the following line: document.scripts('script1').src='quizpm/'+d1+''+d2+'.js'; I don't exactly know what's going on in there, and how this game works, I have to spend lot more time to figure it out. So I'll direct you in the right direction For debugging huge scripts like this, you need a javascript debugger. Best one around is "FireBug" for Firefox. Just install it and enable console logger for Scripts. You might also want to put some missing semi-colons in 11.js and other bits of the script as it's always a good practice.
  11. Hi, Please post the Javascript code where the Data is held and any other Javascript codes. Also could you please specify exactly how it's behaving online, what's going wrong etc and please be specific as possible. "Behaving Differently" is not a very specific problem, so I can't really give you a specific solution.
  12. jQuery might be your answer: www.jquery.com It is a fantastic Javascript framework, and the code is almost human readable :cool: When people answer correctly, where does the "Correct" and "Incorrect" strings come from? Are they hidden fields that are displayed? Or are they injected into the document (DOM) using Javascript's append or prepend functionalities? In any case, the way to approach it would be to give a class to the "Correct" or "Incorrect" strings and inject them into the DOM using jQuery like so: var correctString = "Correct"; var incorrectString = "Incorrect"; if(your checking condition for correct answer){ jQuery("div.question1").append(correctString); }else{ jQuery("div.question1").append(incorrectString); } So these strings will be inserted into the HTML depending on how the user answered. So because these tags have a class, this enables you to count their numbers using jQuery: (if you don't understand the following code, then please have a look at jQuery's homepage and documentation) jQuery(function(){ // jQuery("span.correct") will collect a jQuery object of ALL the spans with class 'correct' // .size() method will return the number of items in the object collection, starts at 1 and NOT 0 which is great var RT1 = jQuery("span.correct").size(); var RT2 = jQuery("span.incorrect").size(); var successRate = (RT1/(RT1 + RT2)) x (100/1); }) Something along these lines Good luck.
  13. I actually use Dreamweaver and Fireworks on a daily basis. However I never used them to create any scripts and code, Fireworks and Dreamweaver created code is so hard to read, and although it does the job, it's chunky, cluttered, messy, and people who use it will never learn how to actually create these things, in my humble opinion. If you wish to learn, learn it the proper way: http://htmldog.com/articles/suckerfish/dropdowns/ This is called "Son of Suckerfish" drop-down style menu, which is a re-worked version of the old "Suckerfish" menu and it can incorporate multiple levels of dropdowns, which works for IE 6+ and all other browsers. It's not hard to implement if you know a bit of HTML, and the Javascript code is actually constant, meaning you don't have to change anything except copy it & paste those few lines of code. There's a fair bit of CSS play, but it's all explained with lots of nice examples on the actual website, so instead of re-inventing the wheel, i decided to provide u with the link. Good luck.
  14. Basic onmouseout delays can be achieved with setTimeout javascript. onmouseout="setTimeout(myFunction, 5000);" myFunction can add or remove the classes. 5000 means 5 second delay. But there's much much easier ways to achieve these things now using Javascript libraries such as jQuery or Prototype or MOOTools etc. You should head over to their websites and check them out. My personal favorite is jQuery for it's extensibility and it's simplicity! jQuery basically makes Javascript code human readable
  15. Hi, when you're writing out the using PHP try: <?php for($j=0;$j<$rows;$j++){ $array = mysql_fetch_array($result); echo ''.$array['title'].''; } ?> (Notice the extra "value='noteX'" parameter on the ) now you can put on the an onChange event to fire a function: This will enable us to fire a function called fillTextArea() whenever the Select box's selected option changes. So therefore you might wanna add an initial blank option, before the PHP Loop. You fillTextArea() function will look something like this: Above code is not tested so if it doesn't work then Sorry Good luck.
  16. Nice tutorial and info about radio buttons here: http://www.somacon.com/p143.php
  17. You do not create decisions on the fly. You pre-create the possible conditions that the user may choose. What you want to do there is quite advanced and I think you should have few basic tutorials in Javascript first. But to elaborate and expand on your idea, writing or other HTML elements using Javascript is not really recommended. What you should do is have a script that can hide/show or block elements. Then place the inputs in the block elements and set their style to display:none. Then you can start using the events (onClick, onFocus, onBlur etc) to fire/initiate functions: Above is not tested, however it's just a basic idea of how you would write your code. However if you use "JQuery" javascript library, it will make your life 100% easier
  18. <?php // get contents of a file into a string $filename = "/path/to/your.txt"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); echo "$contents";
  19. Somewhere in your Javascript files ( probably ac_activex.js as it's the only javascript file in your page ) you have a line that says: document.forms.paypal_form This is NOT a standard way of calling forms by name. Internet explorer may understand this javascript, but Firefox doesn't because it complies to standards, unlike some other browsers I mentioned before it So all you need to do to get rid of this error is change the line to: document.forms['paypal_form'] Which is the standard way of calling forms by name. BUT there is no html element in your HTML code, So it would be safer to remove it.
  20. HTML is what your Browser reads. It's a mainstream language that all browsers and websites use. When a person requests a website page, the server send a HTML page to the user's browser. This HTML page will be same to all users who request it. Therefore HTML is a STATIC language. You cannot perform Calculations, Functions or complex decisions within HTML. PHP is a server-side code. Server-Side means that this code is processed on the server, and only the Server can understand and process this code. After the server finishes processing the PHP code the file is then sent to the user's browser. So for example if some page served the Server's time: Each time the request is made to that page, the server processes the PHP code to display time, and sends it to the requester's browser. So every page sent will be different from the previous, because the time changes on each request. I hope that's helpful
  21. Can be a number of different reasons for this. Check your HOSTS file: WINDOWS\system32\drivers\etc\hosts (open it with Notepad) do you see a line in there: 127.0.0.1 localhost if not then add it to the bottom of the file and save it. Or it could be a browser configuration issue. If you're using Internet Explorer then use Firefox
  22. not sure about Q1, but for Q2 i think the correct syntax is class Bar extends foo { ... } u forgot the keyword 'extends' to iniciate inheritance.
  23. Or you can also just include a dot in front of the equal sign on your original code. Result would be the same ... while($count<=8){ $stringData .= $prefix . "000" . ++$count . "\r\n"; //Notice the . (dot) in front of the equal sign } ... .= is basically a shortcut. In your case it just means: $stringData = $stringData . $prefix ..... and so on So $stringData get a new value ADDED to it, instead of taking a new value on each iteration. And instead of writing to a file everytime in the loop, it would be better for performance if your code wrote to a file only ONCE at the end of the loop.
×
×
  • Create New...