Jump to content

RichardRotterdam

Members
  • Posts

    1,509
  • Joined

  • Last visited

Everything posted by RichardRotterdam

  1. OK this is probably impossible but I am wondering if there is a way. Let me give an example first lets say i have an javascript object function Cat(){ this.name; this.showVar=function(){ }; } //create object var DJ_Kat=new Cat(); here is the trickey part I was wondering if i could make the function showVar alert the variable its stored in. in code //this will alert "DJ_Kat" this.showVar() is this even possible or do i have to store the var name inside a var? because when i try alert(DJ_Kat); it shows clearly that its an object
  2. if your planning on a drag and drop functionality divs are definitely the way to go and tables will get you nowhere
  3. well just post your HTML code as shown in your browser source and lets see whats wrong
  4. using single quote or double quote doesn't really matter for CSS but if you want to know how to use double quote with php here is how to echo("<div class=\"class\"></div>"); simply put slash infront of the double quote. can you post your HTML source as shown in your browser I am 100% your goal can be reached with your approach it's prob just a CSS thing
  5. its because the script counts all input fields including text fields try putting the radio buttons in a div with ID <script> function validateCheckboxes(){ var formblock= document.getElementById('inputboxes'); var forminputs = formblock.getElementsByTagName('input'); for(i=0;i<forminputs.length;i++){ if(forminputs[i].checked) { alert("checkbox"+i+"=checked"); }else{ alert("checkbox"+i+"=not checked"); } } } </script> <form id="my_form"> <div id="inputboxes"> <input type="checkbox" /> <input type="checkbox" /> </div> </form><button onclick="validateCheckboxes()">validate</button> Don't know if the tables will interfere though I wouldn't use them anyway tables simply suck for layout they only thing tables are usefull for is getting data that is retrieved from a database or other data
  6. hi try this <script> function validateCheckboxes(){ var formblock= document.getElementById('my_form'); var forminputs = formblock.getElementsByTagName('input'); for(i=0;i<forminputs.length;i++){ if(forminputs[i].checked) { alert("checkbox"+i+"=checked"); }else{ alert("checkbox"+i+"=not checked"); } } } </script> <button onclick="validateCheckboxes()">get the number</button> <form id="my_form"> <input type="checkbox" /> <input type="checkbox" /> </form>
  7. With you php script it is a bit more complicated then just using javascript. But first things first. From a input field to javascript seems to be the first thing to do. this is how you can get a input value to javascript variable <script> function getProductNr(){ var productNr; //this is where you retrieve the value from the input field with the id product_number productNr=document.getElementById('product_number').value; //alert the value to see if it worked alert(productNr); } </script> <!--be sure that the input field has an id--> <input id="product_number" type="text" /> <!--button that calls the function getProductNr()--> <button onclick="getProductNr()">get the number</button> you will need to check if the product number is a number you can find plenty of scripts for that. Guess this should be your first step.
  8. You shouldn't cross post even though this is the right place to post it. http://www.phpfreaks.com/forums/index.php/topic,149259.0.html
  9. CSS has nothing to do with your php code since your CSS style works client side not serverside your browser never gets to see a single line of php code. Somehow your generated HTML goes wrong. Try to view the source of your browser to see what goes wrong. Your php code looks fine to me I think its the div that contains all the floating divs
  10. how come you can't use &nbps; and have you tried giving the td a width and height
  11. Are you combining a php shoping cart script or are you just using javascript? If you just want to change the text on your HTML page without a refresh you should look for tutorials of javascript DOM. the function getElementById().innerHTML and getElementById().value etc are the ones you will need to use i think
  12. you should search for RTE or "rich text editor" comparison sites. I have experience with FCKeditor and tinyMCE. I prefer tinyMCE because its a lot easier to put in your HTML
  13. What is it exactly that you want to be unique? A database record?
  14. I don't think that is possible with CSS maybe in the future with CSS 3 but not right now. If you want to accomplish that I think you will need a php solution
  15. You should use both. You need serverside scripting and clientside scripting(you could refresh the page every second without using javascript but that would be hideously ugly) .I believe there are plenty of free chat program scripts online most of them using flash I believe you might wanna look around before you build one yourself.
  16. thanks for the tip i will check it out
  17. Hi, I am looking for a php framework or library that mainly makes validating forms a lot easier I don't really care about other stuff. I mostly find that validating forms take up most of my time. Template things are the least of my concerns. Can someone reccomend a framework or library for me.
  18. gottah agree with andy. Avoiding tables for layout is a good thing but this doesnt mean you shouldn't use tables at all. Data like database records or personal data or what ever perfectly fits in tables
  19. I noticed this topic was also on the php section. http://www.phpfreaks.com/forums/index.php/topic,148720.0.html you could also just modify one of these script which doesnt seem hard at all and one solution i noticed didnt envolve any js coding
  20. getting the value of a select is easy <!--this.value is passed to the function showValue()--> <select id="myselect" onchange="showValue(this.value)"> <option value="1">1</option> <option value="2">1</option> <option value="3">1</option> </select> <script> function showValue(val){ //this will alert the value of the selected option alert(val); } </script>
  21. you will need an input with the onchange thing <input onchange="changeSelect(this.value)" /> the changeSelect function must then check if the input is a number(plenty of scripts to find online for that) and then change the page html using javascript DOM
  22. Sounds interesting I have the working code for the chain select using Ajax mootools. Only thing that has to be changed is that the php code to select the data from the mysql database. I assume you are familiar with php and mysql so that shouldn't be a problem. How much do you offer for the code?
  23. do you mean the 5th option in a select box? example: <select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select>
  24. I dont get it what do you want exactly can you be more clear or paste some code?
  25. Build it for you nope give you some hints yup. I have tried that dynamic trive thing way to much arrays and complicated javascript it can be done much easier. this is what you need to do. 1.) create select boxes and link them to javascript <select name="myselect" onchange="getValues(this.value)"> <option value="0">0</option> <option value="1">1</option> </select> 2.) trigger a ajax script when the value of the select is changed look for ajax scripts in tutorials and just modify it. 3.) When the ajax script has returned a value from your external php file you can manipulate your HTML using getElementById().innerHTML
×
×
  • 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.