how to get the value of selected date?

Family of visual date and/or timestamp pickers. Let your visitors pick date from nice looking calendar rather than type in text edit box. Help avoiding date format related problems. Great flexibility and wide browsers support.

how to get the value of selected date?

Postby sssscooter » Wed Sep 19, 2012 4:21 pm

hi ,
i have a form like that
Code: Select all
<form action="" method="POST" id="form0">
                 <input type="text" name="date0" class="tcal" value="the_value_here" readonly="readonly" /><br />
                 <input type="image"  src="/submit.png" onclick =" return displayv()" />
             
                  <input type="hidden" name="submit0" value="the value_here" />
            </form>

the_value_here im wondering what it will be , so if the user selected date , then this value will be the date selected . I have used isset and $_POST but those are only when submitting the form and after it checks , but me i want to check it before submitting in javascript . to see if its null or not.
so what will be the value there please ?
i have so long this in my javascript
Code: Select all
  if (  "<?php $_POST['submit0']; ?>" == "" )
but it always null . because its not checked , it comes from jabascript code.
any help pls
sssscooter
 
Posts: 3
Joined: Wed Sep 19, 2012 4:06 pm

Re: how to get the value of selected date?

Postby tigra » Wed Sep 19, 2012 9:17 pm

Seems like you're a bit confused with what code runs in the browser and what runs on the server.

Say you have:

Code: Select all
<form name="formname" ... >
<input type="text" name="inputname" value="blahblah" />
</form>


To read the value of the text or hidden input with JavaScript you do:

Code: Select all
<script>
var s_value = document.forms['formname'].elements['inputname'].value;
alert(s_value);
</script>


alternatively:

Code: Select all
<form name="formname" ... >
<input type="text" name="inputname" id="inputid" value="blahblah" />
</form>

<script>
var e_input = document.getElementById('inputid');
var e_value = e_input.value;
</script>
tigra
Site Admin
 
Posts: 30
Joined: Fri Jun 29, 2012 12:06 pm

Re: how to get the value of selected date?

Postby sssscooter » Fri Sep 21, 2012 7:36 am

thx , its that what i want . it helped :)
sssscooter
 
Posts: 3
Joined: Wed Sep 19, 2012 4:06 pm


Return to Tigra Calendar Product Family

cron