Post input Box value inside div in php

Amy

i have a input box that is within a div.This input box is replaced by another input box onchange the select box value.now i want to post this input box value in php variable so that i can insert it into database. here is my input box before onchange select box value:

<div id="pay"><input type="text" name="cheque_no" /></div></td>

function of onchange select box is below:

 function changeVal2(value)
{
    var rows = document.getElementsByTagName('label');
    var rows2= document.getElementById('pay');
    var xx=document.getElementById('myid');
    var yy=xx.innerHTML;
    var txt=document.getElementById('txtbox');
    var txt2=txt.innerHTML;
    for(var i in rows)
    {
        if(rows[i].id == 'mylabel')
        {
        if(value=="Direct To Bank")
            {
            rows[i].innerHTML = "Bank Account";     //for display only a single value that is currently selected

            rows2.innerHTML=yy;
            document.getElementById('myid').style.display='none';
            //rows[i].innerHTML += value;           //for gettting all those values that are selected again and again
            }
            else
            {
            rows[i].innerHTML = "Cheque/DD No.";
            rows2.innerHTML=txt2;
            }

        }   
    }

}

here is the input box that is replaced after onchange select box value:

<div id="txtbox" style=""><input type="text" name="cheque" id="cheque" /></div>

now i want to post this input box value in php variable as follows:

echo $cheque_no=$_POST['cheque'];

please give me suggestion for this problem.I have spend 3-4 hours on this problem.Thanks in advance...

Dinesh

If I could better understand your problem that you are trying to replace div element by onchange on the same page, its mean the existance of that input box is twice on that page, and for post via php you have to make input element name as array like this...

<div id="txtbox" style=""><input type="text" name="cheque[]" id="cheque" /></div>

and try to post it with php as $_POST['cheque'][0] or $_POST['cheque'][1].

If you are facing double existance of input box then it will definately resolve your issue...

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Bounding box/boxes inside a div

分類Dev

Jquery on php in div box not working

分類Dev

PHP「php:// input」と$ _POST

分類Dev

POST selected value in php

分類Dev

Not Updating setTimeout() value on click from input box

分類Dev

How to center input-group inside a div?

分類Dev

Using jquery to insert data into an input box, but it does not POST to server

分類Dev

How to be able to scroll an overlayed div inside a flex box (CSS)?

分類Dev

Display data inside input value using Jade

分類Dev

Editing an html <div> inside a PHP statement

分類Dev

Make invisible div work inside php loop

分類Dev

AngularJS - update value of input box in a dynamic table on button click

分類Dev

Input box with pipe does not update value when space is removed

分類Dev

How to show/hide div element after dynamically loading options in select box inside these div's?

分類Dev

echo inside a value to be outputted as echo | PHP

分類Dev

How to remove and change the value inside of Session php?

分類Dev

How to write one js var value inside input html

分類Dev

Change input value inside TD using row and column index

分類Dev

Disable input element based on PHP variable value

分類Dev

How to post a different value from that shown in a select form input

分類Dev

How to add php content or variable inside javascript alert box?! javascript, php, alertbox

分類Dev

cannot get value from textbox inside table div using jquery

分類Dev

print value of content inside div class for Python Beautiful Soup

分類Dev

How to Post both Files and Other Types of Input in PHP?

分類Dev

AngularJS: Render tags dynamically in a separate div from a input box multiple times

分類Dev

how to use div tag inside <td> in php code

分類Dev

How do i make PHP echo only inside div?

分類Dev

checking for a duplcate value entered inside dropdown box with same class through jquery

分類Dev

Is there a simple input box in Cocoa?

Related 関連記事

  1. 1

    Bounding box/boxes inside a div

  2. 2

    Jquery on php in div box not working

  3. 3

    PHP「php:// input」と$ _POST

  4. 4

    POST selected value in php

  5. 5

    Not Updating setTimeout() value on click from input box

  6. 6

    How to center input-group inside a div?

  7. 7

    Using jquery to insert data into an input box, but it does not POST to server

  8. 8

    How to be able to scroll an overlayed div inside a flex box (CSS)?

  9. 9

    Display data inside input value using Jade

  10. 10

    Editing an html <div> inside a PHP statement

  11. 11

    Make invisible div work inside php loop

  12. 12

    AngularJS - update value of input box in a dynamic table on button click

  13. 13

    Input box with pipe does not update value when space is removed

  14. 14

    How to show/hide div element after dynamically loading options in select box inside these div's?

  15. 15

    echo inside a value to be outputted as echo | PHP

  16. 16

    How to remove and change the value inside of Session php?

  17. 17

    How to write one js var value inside input html

  18. 18

    Change input value inside TD using row and column index

  19. 19

    Disable input element based on PHP variable value

  20. 20

    How to post a different value from that shown in a select form input

  21. 21

    How to add php content or variable inside javascript alert box?! javascript, php, alertbox

  22. 22

    cannot get value from textbox inside table div using jquery

  23. 23

    print value of content inside div class for Python Beautiful Soup

  24. 24

    How to Post both Files and Other Types of Input in PHP?

  25. 25

    AngularJS: Render tags dynamically in a separate div from a input box multiple times

  26. 26

    how to use div tag inside <td> in php code

  27. 27

    How do i make PHP echo only inside div?

  28. 28

    checking for a duplcate value entered inside dropdown box with same class through jquery

  29. 29

    Is there a simple input box in Cocoa?

ホットタグ

アーカイブ