SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Show forms on same page

    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.

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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).

  4. #4
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can u be more clear,how to do this.

  6. #6
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  7. #7
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks rajug for reply,
    Do u have idea how to do this with js or some js code with php.

  8. #8
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmarif4u View Post
    Can u be more clear,how to do this.
    It's complicated. Use the PHP to look for a certain name/value pair of the special submit button. When it's present show the page again with more elements. If you want to preserve any values in the form, then you will need to output them on the page as well.
    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.

  9. #9
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mmarif4u View Post
    Can u be more clear,how to do this.
    Quote Originally Posted by mmarif4u View Post
    Thanks rajug for reply,
    Do u have idea how to do this with js or some js code with php.
    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:
    Code:
    function submitmyform(fm){
    fm.method="post";
    fm.action="yourcurrentfilename";
    fm.submit;
    }
    Then use this function like this:
    Code:
    <select name=cmblist onChange="submitmyform(this.form);">
    <option>Here</option>
    </select>
    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.
    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?
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  10. #10
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  11. #11
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  12. #12
    SitePoint Guru mmarif4u's Avatar
    Join Date
    Dec 2006
    Location
    /dev/swat
    Posts
    619
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks fo rthe links.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •