Code: Select all
<input type="text" value="<?php if(isset($city)) {echo $city;} ?>"Code: Select all
document.getElementById("id").selected=true
Where I'm coming in conflict is when I use the DOM object I'm not sure how I can echo the php $state variable for the DOM objects arguement. This is what I have so far.
Code: Select all
<?php if(isset($state)) {?><script type="text/javascript">document.getElementById(<?php if(isset($state)) {echo $state;}?>).selected=true</script> <?php ;} ?>