Home > Backend Development > PHP Tutorial > 关于换行的问题

关于换行的问题

WBOY
Release: 2016-06-23 13:43:12
Original
1046 people have browsed it

做一个查询手机系统,销售可以选择时间,库存查询时为当前库存不需要时间选择。两个功能做在一个页面。由于还不涉及javascript,活学活用了一把javascript。功能达到了,但是问题出来了,请看图,日期换了行,起始日期应该一行显示!请各位老大指教,谢谢! 。

<html><head><title>test javascript</title><script language="javascript"><!--        function selType(){	     var obj=document.getElementById("change");	     if(obj.value=="sale"){		    sel.sett1.style.display="block";			sel.sett2.style.display="block";		 }else{		    sel.sett1.style.display="none";			sel.sett2.style.display="none";		 }	}--></script></head><body><form id="sel" name="sel" action="???" method="post">	<select name="sale" id="change" onchange="selType()">	<option value="sale">销售</option>	<option value="stock">库存</option>		<input type="text" id="sett1" style="display:block" name="startdate" value=<?php echo date('Ymd',strtotime('-30 day'));?>  size ='8' />	-<input type="text" id="sett2" style="display:block" name="enddate" value=<?php echo date('Ymd',strtotime('-0 day')); ?> size='8' /></form>	</body></html>
Copy after login


回复讨论(解决方案)

style="display:block"

用了block?然??行了,改?inline

<html><head><title>test javascript</title><script language="javascript"><!--         function selType(){         var obj=document.getElementById("change");          if(obj.value=="sale"){            sel.sett1.style.display="inline";            sel.sett2.style.display="inline";         }else{            sel.sett1.style.display="none";            sel.sett2.style.display="none";         }    }--></script> </head><body><form id="sel" name="sel" action="???" method="post">    <select name="sale" id="change" onchange="selType()">    <option value="sale">销售</option>    <option value="stock">库存</option>	</select>         <input type="text" id="sett1" style="display:inline" name="startdate" value="<?php echo date('Ymd',strtotime('-30 day'));?>"  size ='8' />    -<input type="text" id="sett2" style="display:inline" name="enddate" value="<?php echo date('Ymd',strtotime('-0 day')); ?>" size='8' /></form>   </body></html>
Copy after login
Copy after login
;

style="display:block"

用了block?然??行了,改?inline

<html><head><title>test javascript</title><script language="javascript"><!--         function selType(){         var obj=document.getElementById("change");          if(obj.value=="sale"){            sel.sett1.style.display="inline";            sel.sett2.style.display="inline";         }else{            sel.sett1.style.display="none";            sel.sett2.style.display="none";         }    }--></script> </head><body><form id="sel" name="sel" action="???" method="post">    <select name="sale" id="change" onchange="selType()">    <option value="sale">销售</option>    <option value="stock">库存</option>	</select>         <input type="text" id="sett1" style="display:inline" name="startdate" value="<?php echo date('Ymd',strtotime('-30 day'));?>"  size ='8' />    -<input type="text" id="sett2" style="display:inline" name="enddate" value="<?php echo date('Ymd',strtotime('-0 day')); ?>" size='8' /></form>   </body></html>
Copy after login
Copy after login
;



谢谢,解决了。看来要学javascript了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template