datetimepicker不想要我的php变量

I have a big problem which really confused me the last five hours.

I use datetimepicker.

<?php
$tabname = "frequency";
$datumstart = "'#datumstart".$tabname."'";
?>
<script type ="text/javascript">
$(function(){$(<?php echo $datumstart; ?>).datetimepicker();
</script>
<input type="text" name="datumstart<?php echo $tabname; ?/>

I want to get the value of the input-field with

$(function load() {
var datumstart = $(<? php echo $datumstart; ?>).val(); });

So everytime I want to run the file with this line

var datumstart = $(<? php echo $datumstart; ?>).val(); });

the alert-output of var datumstart is blank.

But with this

var datumstart = $('#datumstartfrequency').val(); });

I get the value!

What can be wrong?

查看全部
dpeqsfx5186
dpeqsfx5186
2013/01/17 15:49
  • php
  • html
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复