Hi guys,
I have a page where a dropdown menu is shown,
For example if the user select 3 from that menu,then three forms comeout
on the same page without refresh,
Is this possible with js...
If yes then how,
Thanks in advance.
| SitePoint Sponsor |




Hi guys,
I have a page where a dropdown menu is shown,
For example if the user select 3 from that menu,then three forms comeout
on the same page without refresh,
Is this possible with js...
If yes then how,
Thanks in advance.
Yes... but what happens when JS support isn't available?
What good is adding more forms when you can only submit one at a time?
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.




Thanks for reply,
Yes u r right, and i also know this, that if js in disabled then...
But the problem is that My boss want, that i show forms on one page..
By the way is thier any option to do this with,
I am using php(is this possible in php).
Sure, you can submit a form on the page and reload the page with more elements with PHP.
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.




Can u be more clear,how to do this.
When the page will be reloaded. I think this will also use the javascript too because if you want to submit the form on onChange event of the dropdown (select) , won't the javascript be used there?




Thanks rajug for reply,
Do u have idea how to do this with js or some js code with php.
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
Do you want this to be without refreshing the page or it is ok with refreshing too? I think you know with refreshing the page. Just submit the current form on the onChange event of the select (dropdown).
The code to submit the form is:
Then use this function like this:Code:function submitmyform(fm){ fm.method="post"; fm.action="yourcurrentfilename"; fm.submit; }
And after the page is refreshed you can have the number that you have selected, after all you can create the forms or do whatever you want to do with the number.Code:<select name=cmblist onChange="submitmyform(this.form);"> <option>Here</option> </select>
Note : remember that the way i am talking about is by refreshing the page only. You have to do something else for without refreshing. I have to see more for this.
Does this help you mmarif4u?




Thanks rajug very much.
Ofcourse this will help,
But the problem is that i want it without refreshing the page,
Bcoz i have a form already on this page, when
the user fill in that form,but after refresh the page by that dropdown button,
the fields will be empty.
So also i want that for example that user select 2 from that dropdown list
then two forms will be showed with the existing one which is filled
by the user already.
To do this without reloading the page, you will need to use the Document Object Model (DOM), which of course won't work when JavaScript support isn't available.
Rough Guide to the DOM
JavaScript tutorial - W3C DOM introduction
http://www.quirksmode.org/js/contents.html#dom
http://www.brainjar.com/
http://developer.apple.com/internet/...ent/dom2i.html
http://developer.mozilla.org/en/docs/DOM:document
http://developer.mozilla.org/en/docs..._DOM_Reference
http://digital-web.com/articles/form...d_the_w3c_dom/
http://www.w3.org/DOM/
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.




Thanks fo rthe links.
Bookmarks