• 締切済み

検索ブログパーツを修正したい。

TMEspionの回答

  • TMEspion
  • ベストアンサー率27% (5/18)
回答No.1

試してみてないので参考程度で。 <div align="left" style="padding-top:2px;"> <div style="float:left;width:20px;"><input type="radio" name="vs" value="" id="radio1" checked="checked" style="border:none;background:none;" /></div> <div style="float:left;width:63px;padding-top:2px;"><IMG src="<% site_info.blog_url %>/img/ico_y.gif" border="0" style="vertical-align:baseline;" /> <label for="radio1">ウェブ</label></div> <div style="float:left;width:20px;"><input type="radio" name="vs" value="<% blog.page_url %>" id="radio2" style="border:none;background:none;" /></div> <div style="float:left;width:65px;padding-top:2px;"><label for="radio2">この記事内</label></div> <div style="clear:left;"></div> </div> を、 <input type="hidden" name="vs" value="<% blog.page_url %>" id="radio2" /> にしたら、消せそうですけど、 検索が動かなくなっても責任取れませんので、 戻せるようにしといた方が良いですよ。 余計なお世話かもしれませんが、 知識が無いのであれば、下手にいじらない方が吉ですよ。

okb2400
質問者

お礼

>知識が無いのであれば、下手にいじらない方が吉ですよ。 そうですね。 初期値を「この記事内」にできたので、そのままにします。

関連するQ&A

  • seesaaブログで検索窓のラジオボタンのデフォルト値を変えるには?

    seesaaブログでブログを書いています。 ブログに検索ウィンドウをつけているのですが、デフォルトではラジオボタンのチェックが ウェブの方にはいっています。 これを記事の方にチェックを入れるにはどうすればいいでしょうか。 seesaaのサポートにも聞きましたが、具体的な操作は案内できないとのことでした。 ------------------------------------------------------------ <script type="text/javaScript"><!-- function sfcheck(){ if (document.seesaaform.vs[0].checked){ document.seesaaform.action='http://search.yahoo.co.jp/search'; document.seesaaform.keyword.name='p'; } if (document.seesaaform.vs[1].checked){ document.seesaaform.action='<% blog.page_url %>pages/user/search/'; document.seesaaform.keyword.name='keyword'; } return true; } //--></script> <div class="sidetitle"><% content.title %></div> <div class="side"> <% content.header -%> <form method="get" action="http://search.yahoo.co.jp/search" style="margin:0;padding:0;" name="seesaaform" onSubmit="return sfcheck()"> <input value="" name="keyword" type="text" size="20" /> <input value="検索" type="submit" class="input-submit" /><br> <div align="left" style="padding-top:2px;"> <div style="float:left;width:20px;"><input type="radio" name="vs" value="" id="radio1" checked="checked" style="border:none;background:none;" /></div> <div style="float:left;width:63px;padding-top:2px;"><IMG src="<% site_info.blog_url %>/img/ico_y.gif" border="0" style="vertical-align:baseline;" /> <label for="radio1">ウェブ</label></div> <div style="float:left;width:20px;"><input type="radio" name="vs" value="<% blog.page_url %>" id="radio2" style="border:none;background:none;" /></div> <div style="float:left;width:65px;padding-top:2px;"><label for="radio2">記事</label></div> <div style="clear:left;"></div> </div> <% content.footer -%> </div> <input type="hidden" name="fr" value="sb-sesa" /><input type="hidden" name="ei" value="Shift_JIS" /> </form> ------------------------------------------------------------ ご回答よろしくお願いします。

  • css フォームのプルボタンを使う場合

    cssでselect(プルダウンメニュー)を定義すると、 その後のフォーム(例えばテキストフィールド)のレイアウトが崩れます。 お詳しい方、ご教授いただければ幸いです。 ======================================= html側の記述です ======================================= <form accept-charset="UTF-8" action="/mmm" > <div style="margin:0;padding:0;display:inline"></div> <div class="field"> <label for="vvv">氏名</label> <input id="vvv_name" name="vvv[name]" size="30" type="text"> </div> <div class="field"> <label for="xxx">好きな果物</label> <select id="xxx" name="site[ftp_id]"><option selected="selected" value=""></option> <option value="1">りんご</option> <option value="2">さくらんぼ</option></select> </div> <div class="field"> <!--#ここのレイアウトが崩れます--> <label for="yyy">好きな動物</label> <input id="yyy" name="yyy[yyy]" size="30" type="text"> </div> </form> ======================================= cssの記述です ======================================= * { margin: 0; padding: 0; } .field { width:500px;} .field label { width:230px; float:left; color:#FFFFFF; background-color:#001207; display:block; height: 2em; line-height :2em; margin-top:10px; } .field input { width:200px; float:left; color:#FFFFFF; margin-top:10px; height: 2em; } .field select { width:200px; float:left; color:#FFFFFF; margin-top:10px; height: 2em; } どうぞよろしくお願い致します。

    • 締切済み
    • CSS
  • IEだけfloatがずれてしまう

    いつもお世話になります。 floatの書き方(IEの注意点?)について教えて頂きたいことがあります。 divで囲んだ文字列の右にボタンを配置していく、というのをfloatにて以下のように定義しました。 Firefox、Chromeでは一列に綺麗に並ぶのが確認できたのですが、IE8、9では、「abc」が右下にずれて しまい、正常に表示されませんでした。 --------------------- <html> <head> </head> <body> <div style="width: 200px; float: left; border: 1px black solid;"> あかさなた<label style="float: right;">abc</label> </div> <input type="button" value="ボタン1" style="float: left;" /> <input type="button" value="ボタン2" style="float: left;" /> </body> </html> --------------------- なぜIEだけこのような挙動になるのでしょうか。 あるいは、この書き方に何か間違いがあるのでしょうか。 宜しくお願いします。

    • ベストアンサー
    • CSS
  • ラジオボタンとフォーム検索の結び付け

    スマホ用にゲームの攻略サイトを作りたいと思っています。 ■やりたいこと■ 値段はわかっているが名前がわからないアイテムの判別。 まずラジオボタンで「武器」か「防具」を選びます。 そして値段を入れると 「武器・600」=勇者の剣 「防具・600」=盾 といったように選んだラジオボタンによって同じ数字でも 表示結果を変えたいと考えています。 ラジオボタン「武器」を選ぶと検索用ボタン「button_1」が表示される。 ラジオボタン「防具」を選ぶと検索用ボタン「button_2」が表示される。 button_1と2の切り分けによってfunctionの切り分けを行っている状態です。 ■問題点■ 「防具」を押す→600を入力→「盾」が表示される→「武器」を押す→「勇者の剣」が表示されてしまう。 チェックボックスの選択を変えても表示結果は再度検索するまでそのまま、 もしくはチェックボックスを選び直した際は前回入力した数値は消えるなど対策を取りたいです。 そもそも他にもっといいやり方があるなど改善案をご教授いただきたいです。 よろしくお願いします。 【HTML】 <body> <div class="top_form"> <form name="test"> <label><input type="radio" name="radio_btn" value="buki" onclick="func();" checked="checked" />武器</label> <label><input type="radio" name="radio_btn" value="bougu" onclick="func();" />防具</label><br> <input id="test_form" type="tel" name="num"> <input id="button_1" type="button" value="button_1" onClick="func()"> <input id="button_2" type="button" value="button_2" onClick="func2()"> </form> </div> <div id="result"></div> </body> 【CSS】 <style> .top_form { width:300px; margin:0 auto; margin-top:30px; } #test_form { width:250px; height:30px; font-size:14px; margin-top:14px; } #button_1 { text-decoration: none; -moz-appearance: none; -webkit-appearance: none; appearance: none; width:90px; height:44px; margin-top:15px; } #button_2 { text-decoration: none; -moz-appearance: none; -webkit-appearance: none; appearance: none; width:90px; height:44px; margin-top:15px; background-color:#36C; } #result { border:solid 1px #666666; margin:0 auto; height:50px; width:200px; font-size:20px; line-height:50px; text-align:center; margin-top:30px; } </style> 【javascript】 <script> function func() { radio = document.getElementsByName('radio_btn'); if (radio[0].checked) { //button_1が出る document.getElementById('button_1').style.display = ""; document.getElementById('button_2').style.display = "none"; } else if (radio[1].checked) { //button_2が出る document.getElementById('button_1').style.display = "none"; document.getElementById('button_2').style.display = ""; } var url = ""; if (document.test.num.value == "600") { url = "勇者の剣"; } document.getElementById('result').innerHTML = url; } window.onload = func; function func2() { radio = document.getElementsByName('radio_btn'); var url = ""; if (document.test.num.value == "600") { url = "盾"; } document.getElementById('result').innerHTML = url; } </script>

  • クリックしたラジオボタンの行番号を取得したい

    Jqueryを用いてクリックしたラジオボタンの行番号を取得したいのですが、 うまくいきません。 次のようなHTMLで <table border="1" style="font-size:12px;"> <tr> <td>2014年06月01日</td> <td> <label><input type="radio" name="rd1" class="rd" value="0" />A</label> <label><input type="radio" name="rd1" class="rd" value="1" checked="checked" />B</label> <label><input type="radio" name="rd1" class="rd" value="7" />C</label> </td> </tr> <tr> <td>2014年06月02日</td> <td> <label><input type="radio" name="rd2" class="rd" value="0" />A</label> <label><input type="radio" name="rd2" class="rd" value="1" checked="checked" />B</label> <label><input type="radio" name="rd2" class="rd" value="7" />C</label> </td> </tr> <tr> <td>2014年06月03日</td> <td> <label><input type="radio" name="rd3" class="rd" value="0" />A</label> <label><input type="radio" name="rd3" class="rd" value="1" checked="checked" />B</label> <label><input type="radio" name="rd3" class="rd" value="7" />C</label> </td> </tr> <tr> <td>2014年06月04日<td> <td> <label><input type="radio" name="rd4" class="rd" value="0" />A</label> <label><input type="radio" name="rd4" class="rd" value="1" checked="checked" />B</label> <label><input type="radio" name="rd4" class="rd" value="7" />C</label> </td> </tr> </table> 下記で選択したラジオボタンの値を取得できるのですが、 行の番号が取れません。 //ラジオボタンを変更 $('.rd').change(function(){ val = $(this).val(); alert("hoge " + val); }); どのようにしたら良いでしょうか? 宜しくお願いいたします。

  • javascript 問題と答え

    独学でjsをやっているのですが、わからないところがあるので質問させてください。 ラジオボタンを選択し、解答ボタンクリックで、オレンジの欄に解答が出るようなプログラムを書いたのですが、実行されません。どこが間違っているのでしょうか。 /* ---------------- ▽▽▽ここから▽▽▽ -------------------------- */ <!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=utf-8" /> <title>js問題</title> <style type="text/css"> body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6, pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{ margin:0;padding:0; } img{ border:0; } h1 { font-size:22px; } h2 { font-size: 12px; } #box { width: 500px; overflow:hidden; /*子要素にfloatがあり、高さ算出のため使用*/ } div.box { width: 150px; float: left; background-color: #CCC; margin-left: 10px; } li { list-style:none; } div#ans { width: 500px; height: 20px; clear:both; margin-top: 20px; margin-bottom: 30px; } div#ans p { width: 150px; background-color: #FC6; margin-left:10px ; float:left; } div#ans_btn { width: 200px; clear:both; margin-left:200px; } </style> </head> <body> <h1>Q.問題</h1> <br /> <div id="box"> <div class="box"> <ul> <h2>問題その1</h2> <li><input type="radio" name="q0" value="1">あいうえお</li> <li><input type="radio" name="q0" value="2">正解</li> <li><input type="radio" name="q0" value="3">あいうえお</li> <li><input type="radio" name="q0" value="4">あいうえお</li> </ul> </div> <div class="box"> <ul> <h2>問題その2</h2> <li><input type="radio" name="q1" value="1">あいうえお</li> <li><input type="radio" name="q1" value="2">あいうえお</li> <li><input type="radio" name="q1" value="3">正解</li> <li><input type="radio" name="q1" value="4">あいうえお</li> </ul> </div> <div class="box"> <ul> <h2>問題その3</h2> <li><input type="radio" name="q2" value="1">正解</li> <li><input type="radio" name="q2" value="2">あいうえお</li> <li><input type="radio" name="q2" value="3">あいうえお</li> <li><input type="radio" name="q2" value="4">あいうえお</li> </ul> </div> </div> <div id="ans"> <p>問い1答え</p> <p>問い2答え</p> <p>問い3答え</p> </div> <div id="ans_btn"> <input type="button" value="ここを押すと解答" onClick="saiten()"> </div> <script type="text/javascript"> var ans = ["2","3","1"]; function saiten(){ var p_node=document.getElementsByTagName("p"); for(var i=0;i<ans.length;i++){ if(ans[i]==document.getElementById("q"+i).value){ p_node[i].innerHTML = "正解"; }else{ p_node[i].innerHTML = "間違い"; } } } </script> </body> </html> /* ----------------△△△ここまで△△△------------------------ */ よろしくおねがいします。

  • PHPでの検索

    初心者です。 ネットもさがしてみたのですが下記の意味がイマイアチわかりません。 <form name="form2" action="search.php" method="post"> <input type="text" name="keyword" size="25" value="<?= $keyword ?>"> <input type="submit" name="search" value="検索"><br /> <input type="radio" checked name="searchSelect" value="AND">AND  <input type="radio" <?= ($searchSelect == "OR")? "checked" : "" ?> name="searchSelect" value="OR">OR </form> (1)<form name="form2" action="search.php" method="post"> 検索ボタンを押すと「action="search.php"」が起動します。  どういう仕組みなのでしょうか。 (2) <input type="text" name="keyword" size="25" value="<?= $keyword ?>">  作者の説明で、  『前の画面でテキストボックスに入力した値を、デフォルトで表示しています。  <input type="text" name="keyword" size="25" value="<?= $keyword ?>">』  となっていますが、value="<?= $keyword ?>"でなぜそうなるのでしょうか。  また、<?= $keyword ?>の<?= ?>構文はどのような機能があるのでしょうか。 (3)<input type="radio" checked name="searchSelect" value="AND">AND  「value="AND">AND」の右側の「AND]はどういう意味でしょうか。 (4)<input type="radio" <?= ($searchSelect == "OR")? "checked" : "" ?> name="searchSelect" value="OR">OR  作者の説明で、  『(6)前の画面でORラジオボタンが選択されていた場合は、選択(checked)します。  <input type="radio" <?= ($searchSelect == "OR")? "checked" : "" ?> name="searchSelect"  value="OR">OR』  とありますが、<?= ($searchSelect == "OR")? "checked" : "" ?>でなぜそういうことができているのでしょうか。  また、『"checked" : 』の『:』は何の役目をしているのでしょうか。 上記4つの質問でどれでもいいですのでどなたかお教え願えないでしょうか。

    • 締切済み
    • PHP
  • jsでラジオボタンによって表示内容を変えたい

    とても困っているのでお力をお貸しください。 HTML側に ==================================================== <table summary="条件問題"> <tr> <th>問題1</th> <td> <ul> <li><input type="radio" name="AAAAAA" value="あああ" id="a1" onclick="mondaiChange1();"/> <label for="a1"> あああ</label></li> <li><input type="radio" name="AAAAAA" value="いいい" id="a2" onclick="mondaiChange1();"/> <label for="a2"> いいい</label></li> <li><input type="radio" name="AAAAAA" value="ううう" id="a3" onclick="mondaiChange1();"/> <label for="a3"> ううう</label></li> <li><input type="radio" name="AAAAAA" value="えええ" id="a4" onclick="mondaiChange1();"/> <label for="a4"> えええ</label></li> <li><input type="radio" name="AAAAAA" value="おおお" id="a5" onclick="mondaiChange1();"/> <label for="a5"> おおお</label></li> </ul> </td> </tr> </table> <div class="TableA"> <table summary="問題その2" id="TableA"> <tr> <th>Q1</th> <td> <ul> <li> <input type="radio" value="はい" id="b1" name="BBBBBBB" /> <label for="b1"> はい</label> </li> <li> <input type="radio" value="いいえ" id="b2" name="BBBBBBB" /> <label for="b2"> いいえ</label> </li> </ul></td> </tr> </table> <div class="TableB"> <table summary="問題その2" id="TableB"> <tr> <th>Q1</th> <td> <ul> <li> <input type="radio" value="はい" id="b1" name="BBBBBBB" /> <label for="b1"> はい</label> </li> <li> <input type="radio" value="いいえ" id="b2" name="BBBBBBB" /> <label for="b2"> いいえ</label> </li> </ul></td> </tr> </table> ========================== と記載。 includeしているjsファイル側に ========================== function mondaiChange1(){ radio = document.getElementsByName('AAAAAA') if(radio["a1"].checked) { //フォーム document.getElementById("TableA").style.display = "none"; document.getElementById("TableB").style.display = ""; } else if(radio["a2"].checked) { //フォーム document.getElementById("TableA").style.display = ""; document.getElementById("TableB").style.display = "none"; } else if(radio["a3"].checked) { //フォーム document.getElementById("TableA").style.display = "none"; document.getElementById("TableB").style.display = ""; } else if(radio["a4"].checked) { //フォーム document.getElementById("TableA").style.display = ""; document.getElementById("TableB").style.display = "none"; } else if(radio["a5"].checked) { //フォーム document.getElementById("TableA").style.display = "none"; document.getElementById("TableB").style.display = ""; } //オンロードさせ、リロード時に選択を保持 window.onload = mondaiChange1; } ========================== としているのですが、これだと最初にアクセスしたとき 問題その2のTableAとTableB両方のテーブルが表示されてしまいます。 (その後ラジオボタンを選択すると希望通りの動作になります。) //オンロードさせ、リロード時に選択を保持 window.onload = mondaiChange1; を入れたら大丈夫というのをネットで見たのですが、どう書き換えてもうまくいきません。 希望としては 最初にアクセスしたときは問題1の回答は何も選択されてない状態で、その下には何も表示されていない。 ↓ 問題1の選択肢を選択した時点で初めて「問題その2」のテーブルが選択したラジオボタンによってどちらかひとつ表示される、という風にしたいのですが、教えていただけないでしょうか?

  • yahooの検索窓の色の変え方

    自分のホームページにyahooの検索窓を設置したのですが検索窓の行が白くなってしまいます。バックの色と同じにするにはどうしたらいいでしょうか?内容はこんな感じです。 <!-- Begin Yahoo Search Form --> <div style="margin:0;padding:0;font-size:14pt;border:none;background-color:#FFF;"> <form action="http://search.yahoo.co.jp/search" method="get" target="_blank" style="margin:0;padding:0;"> <p style="margin:0;padding:0;"><a href="http://search.yahoo.co.jp/" target="_blank"><img src="http://i.yimg.jp/images/search/guide/searchbox/ysearch_logo_110_22.gif" alt="Yahoo!検索" style="border:none;vertical-align:middle;padding:0;border:0;"></a><input type="text" name="p" size="28" style="margin:0 3px;width:50%;"><input type="hidden" name="fr" value="yssw" style="display:none;"><input type="hidden" name="ei" value="▲▲▲" style="display:none;"><input type="submit" value="検索" style="margin:0;"></p> </form> </div> <!-- End Yahoo! Search Form --> よろしくお願いします。

  • オブジェクト名に変数を使いたい

    <form id="form1" name="form1" method="post" action=""> <label for="q1-1"><input id="q1-1" name="q1" type="radio" value="1" />あ</label> <label for="q1-2"><input id="q1-2" name="q1" type="radio" value="0" />い</label> <label for="q1-3"><input id="q1-3" name="q1" type="radio" value="0" />う</label> <label for="q1-4"><input id="q1-4" name="q1" type="radio" value="0" />え</label> <label for="q2-1"><input id="q2-1" name="q2" type="radio" value="1" />あ</label> <label for="q2-2"><input id="q2-2" name="q2" type="radio" value="0" />い</label> <label for="q2-3"><input id="q2-3" name="q2" type="radio" value="0" />う</label> <label for="q2-4"><input id="q2-4" name="q2" type="radio" value="0" />え</label> </form> ============================================================ 上のような4択の問題が10問あります。 これを採点して合計点数を表示させたいと思っていますが、 下記のようにfor文を使う際、オブジェクト名の、"q1"の"1"というところに変数nを使いたいのですが、やり方がわかりません。 ============================================================ for(var n=0;n<10;n++){ var length=document.form1.q1.length; for(var i=0;i<length;i++){ var checked=document.form1.q1[i].checked; if(checked==true){ ans = i; } } var value=document.form1.q1[ans].value; } ============================================================ いろいろ調べてみましたが、うまくいかず固まっております。 どなたかご教授いただけませんでしょうか?