Jump to content

[SOLVED] Text field problem


Markx

Recommended Posts

Hi All

 

I hope you can help.

 

I'm trying to input data into a table cell based on a value inputted into a text field.

The textfield asks for a date. From that the table needs to display the days of the week, so if someone entered 25/9/08 it would have Thursday in column 1, Friday in colum 2 etc.

Also, on the second row it would display the date, so 25/9/08 in column 1, 26/9/08 in column 2 etc.

 

I hope this makes sence ???

 

Thanks

Mark

Link to comment
https://forums.phpfreaks.com/topic/125770-solved-text-field-problem/
Share on other sites

Hi Adam

 

The only coding I've got is

 

<form name="form1" id="form1" method="post" action="">
          Name:
          <input type="text" name="textfield" />
          <br />
        
          First Date back to work: 
          <input type="text" name="textfield3" />
          <br>
	  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
            </tr>
            <tr>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
            </tr>
            <tr>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
              <td> </td>
            </tr>
</table>

 

Not sure what I'm going to do about the date format  :'(

echo the varialbe in the first field, in the next echo the variable +1. etc.

 

so - find the name of the field they enter the information in - for example - date - find method of sending info, POST or GET.

 

then:

 

$date = $_POST['date'];

 

or

 

$date = $_GET['date'];

 

echo it in the cell you want, followed by using http://www.w3schools.com/php/php_ref_calendar.asp to help you with days and incrementing the variable.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.