[英]how to put form text exactly in front of radio button
I want to put 'email me' & 'call me' text exactly in front radio button. 我想在前面的单选按钮中准确地输入“给我发送电子邮件”和“给我打电话”文字。 In code it comes under radio button. 在代码中,它位于单选按钮下方。 Can anybody suggest me how to do this. 有人可以建议我该怎么做。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script>
$('#emailbtn').on('click',function(){
if($('#callbtn').prop('checked'))
{
$('#callbtn').prop('checked','');
}
});
$('#callbtn').on('click',function(){
if($('#emailbtn').prop('checked'))
{
$('#emailbtn').prop('checked','');
}
});
</script>
</head>
html code is html代码是
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<form name="form1" method="post" style="padding-left:8%;">
<input type="radio" value="email" name="select" id="emailbtn" onclick="showemail()" />
Email me :<span id="emailhide" style="display:none"><input type="text" size="50" name="email" id="email_id" placeholder="*************" /><input type="submit" name="email" value="email" id="emailbtn" style="font-size:16px;" onclick="return validation1()" /></span>
<span id="emailid"></span>
</form>
<form name="form2" method="post" style="padding-left:8%;">
<input type="radio" value="call" name="select" id="callbtn" onclick="showphn()" />
Call Me :<span id="phonehide" style="display:none"><input type="text" size="50" name="phn" id="call" placeholder="*************" /><input type="submit" name="submit" value="call" id="callbtn" onclick="return validation2()" /></span>
<span id="phoneno"></span>
</form>
<input type="radio" value="chat" name="select" id="chatbtn" onclick="showchat()" />
Chat with me<span id="chathide"><a href="valency-networks-chat.html"><input style="display:none" type="submit" name="chat" id="chat" value="Go"/></a></span>
Add the radio buttons in the forms: FIDDLE 在表单中添加单选按钮: FIDDLE
<form name="form1" method="post" style="padding-left:8%;">
<input type="radio" value="email" name="select" id="emailbtn" onclick="showemail()" />Email me :<span id="emailhide" style="display:none">
<input type="text" size="50" name="email" id="email_id" placeholder="*************" />
<input type="submit" name="email" value="email" id="emailbtn" style="font-size:16px;" onclick="return validation1()" />
<span id="emailid"></span>
</form>
<form name="form2" method="post" style="padding-left:8%;">
<input type="radio" value="call" name="select" id="callbtn" onclick="showphn()" />Call Me :<span id="phonehide" style="display:none">
<input type="text" size="50" name="phn" id="call" placeholder="*************" />
<input type="submit" name="submit" value="call" id="callbtn" onclick="return validation2()" />
<span id="phoneno"></span>
</form>
$(document).on('ready',function(){$('#emailbtn').on('click',function(){ if($('#callbtn').prop('checked')) { $('#callbtn').prop('checked',''); } }); $('#callbtn').on('click',function(){ if($('#emailbtn').prop('checked')) { $('#emailbtn').prop('checked',''); } }); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> <form name="form1" method="post" style="padding-left:8%;"> <input type="radio" value="email" name="select" id="emailbtn" onclick="showemail()" /> Email me :<span id="emailhide" style="display:none"><input type="text" size="50" name="email" id="email_id" placeholder="*************" /><input type="submit" name="email" value="email" id="emailbtn" style="font-size:16px;" onclick="return validation1()" /></span> <span id="emailid"></span></form> <form name="form2" method="post" style="padding-left:8%;"> <input type="radio" value="call" name="select" id="callbtn" onclick="showphn()" /> Call Me :<span id="phonehide" style="display:none"><input type="text" size="50" name="phn" id="call" placeholder="*************" /><input type="submit" name="submit" value="call" id="callbtn" onclick="return validation2()" /></span> <span id="phoneno"></span> </form>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.