this is my modal button

this is within the table that why i use echo $rows['id']

    <a data-id="<?php echo $rows['id']; ?>" type="button" class="btn btn-success btn-lg btn-block" data-toggle="modal" data-target="#myModal">View Order</a>

this is my modal body

                        $list_query=mysql_query("select * from db where id='$id'");
                    <form class="form-horizontal orderitem" role="form">
                        <div class="form-group">
                            <label for="inputFullName" class="col-sm-2 control-label">Full Name</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="fullname" value="<?php echo $rows['id'];  ?>">

Recommended Answers

All 5 Replies

Just saying, it's very unhelpful when people don't actually post a problem, but hey ho...

I can instantly see one error in your code however, and you are closing one to many <div> tags around line 13-14. So just remove one of those lines and you should be fine.

jsFiddle to show my attemped mockup at what you've done (with php variables substituted).

i want to pass the value of mysql to modal

commented: Tell us what's wrong and what's not working, because that isn't very helpful at all. Help us to help you. -1

Sorry, my magical powers are a bit cloudy this morning, can't seem to guess whats not working for you for some reason...

Show your error messages and actually tell us what isn't working!!!

I'm sorry to be inpatient, but come on that is absolutely rediculous.

there is no error, but the output is not right, the data is not showing up in the modal

Well have you checked to make sure the rest of your markup is like mine in the fiddle. Because the rest of your HTML that you've provided is legitimate (as proved by the fiddle).

I cant see any other reason why it shouldn't show up. What does "View Source" or "Developer tools" show?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.