May 28, 200917 yr I have no idea how to make this site do as i want it to.. http://www.arctics.eu/tdm/default.html I want the Dropdown Menu when chooses other then choose nr of guards to spwan one more table so if i choose nothing only one is there.. if i choose 2 one more apperes and so on untill i hit 10. I have looked at php training video and javascript.. but iam fairly new to all things that are going on about an website... so yes iam a newbie ;) the reason why the site is so plain is because they wish to have it that way.. and yes it's only a beta site.. not near done yet:) And if i dident make myself clear just let me know i will update it with more info.. plz help:D "just ignoore this part" This is one guard info.. If i choose 6 guards i want 6 off this ^ appering Guard Id : Ved og legge inn vakt id nr Bekrefter du at du har gått gjennom Input av infomasjon og at de stemmer. Vakt id er DIN signatur "just ignoore this part"
May 30, 200917 yr It's quite difficult to understand exactly what you need bacause of our obvious language differences. If my understanding of what you want is correct then you would probably be best off using a javascript framework like jQuery and a function like append. I could write you an example but it's getting late and my brains working a bit slow
May 30, 200917 yr as mentioned by dan, you can do it using jQuery. I coded something similar which generates new rows for a form. It makes use of the append function in jQuery, and I wrote a function which makes sure that all the form fields are numbered properly for processing
June 2, 200917 yr Hi, Firstly i would reccomend styling your forms completly with CSS this will allow a much better feel to the style. secondly jquery is farley complexed as i beleive it involves interpreting JS with PHP and its containing database. PHP is capable of performing this function alone with out alot of work. it involves using the "if" statement so for example <?php if ($inputid = $selectid2) in here put your form value and your select value. { echo 'the next form option you wish to display' } else 'if the select id doesnt equal the inputid variable you need to tell php what to do. } ?> this code amy not be clear or correct for what you are wanting but it will produce the values if you look into it further. a great site to learn php on is http://www.killerphp.com with stephan mischooks video tutorials in non nerd terms Good luck Craig
June 2, 200917 yr To create new form rows on the fly, he would be much better off with a javascript solution such as jQuery. You are right, it is possible to create this using PHP but that would require a new page load everytime a new row is appended. This is a waste of server resources when the "append" function in jQuery can be used easy peasy. It is also a myth that jQuery is complex. It is only as complex as the developer makes it just the same as PHP
June 2, 200917 yr secondly jquery is farley complexed as i beleive it involves interpreting JS with PHP and its containing database. Sorry, but I disagree with this. jQuery runs completely independent of PHP and databases, and is a totally different language. PHP is all server-side, whereas JavaScript is client-side. The only relationship they have is AJAX requests, but that's not even necessary for this task. jQuery is pretty straightforward, and to do this task I'd have to agree with Dan and say jQuery is the better option. jQuery also has a clone function, which you can use to create a duplicate of an existing row, use append to add it to the bottom of the form.
June 2, 200917 yr well i stand corrected, that was just my understanding but if i have got it wrong i apologize Craig
Create an account or sign in to comment