Hidden layer containing form fields doesnt submit after being unhidden and filled out

Posted on 2006-04-21
Last Modified: 2008-03-17
Hi All,

Hopefully a nice and simple one. I have a form with some hidden layers containing form fields, using css display:none .

These are then unhidden using some javascript that sets the properties of this layer to display:block .

All works well other than, when the form is submitted the data from these fields doesnt apper in the post data, and hence not in the email that the php script it submits to sends out.

best wishes,

Question by:daveboyle99
    LVL 9

    Expert Comment

    Could we see your code - as even hidden fields should be posted..

    Author Comment

    <script language="javascript">
    function captionjs(selObj){

    <a href="javascript:captionjs()">Click here</a> to add additional drivers

    <div id="captioncontent" style="display:none;">
    <br />
    <b>Additional Driver 1</b>
    <br />
    <br />
    Title: <br />
    <select name="Add_Driver_1_Title">                        
          <option value="0" selected>&gt;&gt; select</option>
          <option value="1">&gt;&gt; Mr</option>
          <option value="2">&gt;&gt; Mrs</option>
          <option value="3">&gt;&gt; Miss</option>
          <option value="4">&gt;&gt; Ms</option>
          <option value="5">&gt;&gt; Dr.</option>
    <br />
    LVL 9

    Accepted Solution

    This piece of code works for me if i put it in a form and submit it.
    Maybe could you post more of your code (so as to see your form, the position of this element in it,..)

    Author Comment

    HI smaccari
    you're right the code works fine it was my php that was at fault, fixed the problem now, thanks for your help.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now