form name value not carrying over.

Posted on 2007-07-23
Last Modified: 2008-03-06
I have a multi-page form that is passing form input from one to the other.  Form 1 must have decimals as part of a javascript calculation for the name but I am noticing that the values are not carrying over to the detination page.  When I remove the decimal it works.  Unfortunately, I have to have them in there.  How do I work around this?  here is an example of the problem.

Form 1:  <select name="test1.00"><option value="3">test</option></select>

Form 2:  <input type="text" name="test1.00" value="<?php echo((isset($_POST["test1.00"]))?$_POST["test1.00"]:"") ?>" />

Form 2 text field is blank.

Thanks in advance!
Question by:pda4me
    LVL 7

    Accepted Solution

    I don't know why, but php changes name to test1_00

    So you need to change your Form 2 to:

    <input type="text" name="test1.00" value="<?php echo((isset($_POST["test1_00"]))?$_POST["test1_00"]:"") ?>" />

    LVL 16

    Expert Comment

    I don't think that the period is a valid character in a form field identifier.

    Could you change the decimal point to a hyphen, so you have test1-00, and then use Javascript to modify that into a decimalised value for your calculation?

    Author Comment

    Thanks ljubiccica, that worked like a charm!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Freelancers to Complete JavaScript Projects

    Source the talented Expert Exchange community
    for top quality work on your JavaScript projects.

    Hire the best. Collaborate easily. Get quality work.

    This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to count occurrences of each item in an array.

    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

    7 Experts available now in Live!

    Get 1:1 Help Now