Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Date field in HTML form

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-07-2010
Member
 
Join Date: Mar 2010
Posts: 338
Date field in HTML form
  

Hello,
I ask a small question. I am sending a form to order. I have two files: test1.php and test2.php. Everything works fine. I would like only the form, there is a field or the user can choose the date of delivery of the product and of course he can not choose a date before the current date. How can I do this? Any help will be appreciated. Thank you.

Reply With Quote
  #2  
Old 22-07-2010
Member
 
Join Date: Jan 2010
Posts: 126
Re: Date field in HTML form

I propose to fill forms to my clients, who will then feed a mysql database, but how to have the date of registration include it?
Is there a miracle function like:
Code:
<Input type = "hidden" name = "date" value = "date???"
I could insert into my form? Thank you all for your help.
Reply With Quote
  #3  
Old 22-07-2010
Member
 
Join Date: Nov 2009
Posts: 343
Re: Date field in HTML form

Why do not you put the date in. via PHP ? because you'd have javascript turned off. So you do something like
Code:
<Input type = "hidden" name = "date" value = "<? Today's date in PHP?>"
Reply With Quote
  #4  
Old 22-07-2010
Member
 
Join Date: Nov 2009
Posts: 518
Re: Date field in HTML form

I injected the code:
<Input type = "hidden" name = "date" value = "<? Php echo date (" cmd");?>">
and everything is OK. In one form, I create a list box to the customer inserts his city. Here's the code:
Code:
 <select name="vl" id="vl"> 
              <option> Choose ...</ option> 
              <option value="vl1"> town1 </ option> 
              <option value="vl2"> vl2 </ option> 
              <option value="vl3"> vl3 </ option> (etc. ..) 
          </ Select>
But if the city of the customer is not in this list, I asked him to return the input directly by the function:
Code:
          <input type="text" name="vl" id="vl">
If the user enters the names of his city by the function input is OK, but if he selects a city from the dropdown list, it is automatically deleted by the function input that follows, and in which n has not returned. What to do? In any case thank you 1000 times for once the date (it's true that I had to post it in php, both for me).
Reply With Quote
  #5  
Old 22-07-2010
Member
 
Join Date: Mar 2010
Posts: 162
Re: Date field in HTML form

You put two fields cities:
Code:
you select your call tw1 
and your input vl2
PHP and you tested:
Code:
if tw1 = name
then vlchoice = vl2 
otherwise vlchoice = tw1
It's not hard to make a php IF statement.
Reply With Quote
  #6  
Old 22-07-2010
Member
 
Join Date: Dec 2009
Posts: 202
Re: Date field in HTML form

This is the code you are looking for
Code:
<form action="" method="post"> 
  <p> 
    Choose your city: 
      <select name="chx1" id="chx1"> 
      <option value=""> Select </ option> 
      <option value="vl1"> town1 </ option> 
      <option value="vl2"> vl2 </ option> 
      <option value="vl3"> vl3 </ option> 
    </ Select> 
</ P> 
  <p> or enter the name of your city: 
    <input type="text" name="chx2" id="chx2"> 
</ P> 
  <p> 
    <input type="submit" name="submit" value="Envoyer"> 
</ P> 
  </ p> 
  </ p> 
  <Php 
 $ d = $ _POST ['chx1']; 
 $ d2 = $ _POST ['chx2']; 
 if ($ d == "") 
 ( 
 ?> 
 <Input type = "hidden" name = "city" value = "<? Echo $ d2;?>"> 
 <? 
 echo $ d1; 
 echo $ d2; 
 
 ) 
 ?> 
</ Form>
Reply With Quote
  #7  
Old 29-07-2010
Member
 
Join Date: Sep 2009
Posts: 152
Re: Date field in HTML form

The problem is that I must submiter TWICE before having the correct value (the correct name of town) in the variable $ Resu-that's a bit messy ... It should be something that "pre-valid" variables and choix1 choix2; I Potash my big books, and I found the "OnBlur" but I know the syntax ... What do you think?
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Date field in HTML form"
Thread Thread Starter Forum Replies Last Post
Google Chrome is opening in basic HTML form instead of the Standard form Beatrix Technology & Internet 5 25-05-2011 10:21 PM
How to make Opera remember form field entries Ansari Bros Technology & Internet 3 02-01-2011 06:29 PM
Switch the 'action' field in an HTML form MarceloQuad Software Development 4 07-02-2010 05:05 AM
Disable yellow autocomplete form field teenQ Technology & Internet 3 06-08-2009 09:57 PM
To access a text field from another form Sanket07 Software Development 6 06-02-2009 05:42 PM


All times are GMT +5.5. The time now is 03:07 AM.