Hi all, am trying to add an html form to a lightbox with no success.
Here is my code:

<a href="service_form.php" rel="lightbox">
<input name='input' type='' class='btn-primary' value='Add a Service Tag' rel='lightbox'>
</a>

Note: I have been able to add an image with the same code and it works fine,so the code is working fine.
Am just having troulble adding a from to the ligthbox popup.

Show us you service_form.php

and the DIv container of the lightbox..

Member Avatar for LastMitch

Note: I have been able to add an image with the same code and it works fine,so the code is working fine.

What issue you are having?

I think lightbox is a related to javascript not php.

You can take a look at here:

http://www.xul.fr/javascript/lightbox-form.html

For a general php form it looks like this:

<form action="service_form.php" method="post">
First Name: <input type="text" name="fname">
Last Name: <input type="text" name="lname">
Age: <input type="text" name="age">
<input type="submit">
</form>

Unless your <form> is connected to the database and you have the code and a query for that then it makes sense if you post here (PHP).

Here is my form

<form name="form1" method="post" action="">
<table class="table table-striped" width="300" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td width="142">&nbsp;</td>
    <td width="144">&nbsp;</td>
  </tr>
  <tr>
    <td>Service Tag Name</td>
    <td><label for="textfield"></label>
      <select name="select" multiple class="chzn-select span6" data-placeholder="Choose Services completed
/s...">
<?php

    $query = "SELECT * FROM cuz_ven order by uz_ze desc";
    $rs = mysql_query($query);                                                                                                  while($row = mysql_fetch_assoc($rs)) 
   {    
    { 
      $uz_ze = $row['uz_ze'];
   echo"<option value='$uz_ze'>$uz_ze</option>";}

        }?>
          </select>
           </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2">
    <input name="addTag" class='btn-primary pull-center' type="button" value="Add"></td>
  </tr>
</table>

</form>

Now I Get It, you want a light box ( a div ) that has the content of a form

I suggest that before your form tag. place a div tag

then use a jQuery. there are a lots lightbox in jQuery

Member Avatar for LastMitch

Am just having troulble adding a from to the ligthbox popup.

I know you post the code but what are you trying to do?

What kind of input form you are talking about?

You only mention you need a form.

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.