<form enctype="multipart/form-data" method="post" action="mailto:[email protected]" accept-charset="UTF-8">
Is there a problem if mails are sent this way .. i wanna avoid using PHP codes..
Hi,
I have a select form element with 5 options. If option 2 is selected I want to display another form input box (this has a style of display:none initially). How can I attach an event to option 2 so that whenever it is selected the input box is shown otherwise it is hidden. I have this currently but this does not handle is option 2 is already selected when the page loads
$('#type').change(function(){
var typeSelected = $(this).val();
if (typeSelected == 2) {
$('#extraInput').show();
}
});
I know I could add another bit of code which checks what is selected on page load but wondered if there was a neater way of doing this. Also something that could handle the hiding of the input box if option 2 is not selected at the start as currently I have just hard-coded style="display:none" onto the input box but I would prefer this to be dynamic.
Thanks
Hi Folks,
Is there a tool out there to measure the actual Render time of an element(s) on a page? I don't mean download time of the resources, but the actual time the browser took to render something. I know that this time would vary based on factors on the client machine, but would still be very handy in knowing what the rendering engine takes a while to load. I would imagine this should be a useful utility since web apps are becoming pretty client heavy now. Any thoughts?
Hello,
I was able to get the navigation dropdown to show the letters in a different color from the background (white in this case) in Chrome browser. But when I view the same page in IE or FF, the whole background is just all green.
Here is an example of such a page:
http://www.comehike.com/hikes/hikes_and_groups.php
And here is the CSS code that makes the color show up white in Chrome
navigation li li a
{color:#white; text-decoration:none;}
To see the difference, just mouse over the top right where it says "community" or "hikes"
Thanks,
Alex
On my site, a user gets email notifications when someone comments on their profile, or comments on their blog etc...I have made a email settings page that has checkboxes to allow the user to decide to receive emails or not.
This is what I am wrapping around the email notification code chunck for the pages that have the php mail:
<?php if(isset($_POST['email_toggle']) && $_POST['email_toggle'] == 'true') { if(isset($_POST['commentProfileSubmit']) && $auth) {
$query etc
$to = etc
}
}
My question is what do I put on the email settings script that has the actual check boxes to make them stay checked or unchecked once you submit your settings? Another words what do I put in the if(isset portion to implement the changes?
if(isset($_POST['email_toggle']) && $_POST['email_toggle'] == 'true') {
/* what do I put here? */
header("Location: Profile.php?id=" . $auth->id);
mysql_query($query,$connection);
/* input/check boxes and submit button */
<tr>
<td class="email_check">
<input type="checkbox" name="email_toggle" value="true" checked="checked" /> Receive email Notifications When Someone Answers A Question You've Answered
</td>
</tr>
<tr>
<td>
<input style="margin:10px 0px 0px 10px;" class="submit" type="submit" name="email_toggle" value="Save Settings" />
</td>
</tr>
}
I'd like to block all characters from being inputed except 0-9,a-z,A-Z range only alphanumeric characters. So when someone types ! for examplee nothing is written into input. How can I do that?
I have a dictionary in jsons form like this:
$user = "{ name: Mary , born: 1963, money: 213 }";
I need to pass it throught this field:
<input type="hidden" name="custom" value="" >
and then insert it in the db:
INSERT INTO user ( name, born, money ) VALUE ( $name, $born, $money )
How can I do that ?
I have to modify an existing web search page.
There is a page, where all the search filters are (form with name "searchform").
When the search button is pressed, results are shown in new window.
Because the search takes up to 30 seconds, and while searching the window stays blank, I have to add a label "Searching. Please wait..." at the new created window with the results.
So the search window is created, and I set it's location to a frameset. First frame will show the label, and the second will show the results. But i can't manage to update the second frame with the results.
Result windows is created as:
var left = (screen.width/2) - 750/2;
var top = (screen.height/2) - 600/2-100;
var styleStr = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=750,height=600,left='+left+',top='+top+',screenX='+left+',screenY='+top;
var msgWindow = window.open('ex_search_frameset.php', 'results_exi', styleStr);
msgWindow.focus();
Than the search is requested:
f = document.searchform;
f.action = 'ex_search_results.php';
f.target = msgWindow.document.res_frame; // here i can't figure out what the target
must be
// or how to post the params from "f" to the second frame "res_frame"
f.submit();
Here is the frameset.
<frameset rows="200,*" border="1" name="SearchFrame">
<frame name="wait_frame" src="ex_search_wait.php" target="right">
<frame name="res_frame" src="ex_search_results.php" target="_self">
</frameset>
Any idea how to do this?
I have two fields which calculate a total, but I have a radio button pair that determines a variable within the equation. Here's the radio button code:
<input type="radio" name="estimate_pool_shape" value="1" /> Angle
<input type="radio" name="estimate_pool_shape" value=".86392" /> Freeform
Immediately after that, this JavaScript is then calculating the surface area of the pool based of these fields and script:
(Length <input type="text" size="5" name="estimate_pool_length"
onBlur="conv2inches(document.forms.mainform);" />) x
(Width <input type="text" name="estimate_pool_width" size="5"
onBlur="conv2inches(document.forms.mainform);" />)
The following JavaScript already works to update the fields, I just need the variable it uses to set the field values to change based on the radio buttons.
function conv2inches(mainform) {
var oin;
var oinches;
if(isNaN(mainform.estimate_pool_width.value)||isNaN(mainform.estimate_pool_length.value)){
alert("Please enter numbers only");
return false;
}
oin = ((mainform.estimate_pool_width.value) + (mainform.estimate_pool_length.value) * %%%RADIO BUTTON VARIABLE HERE%%%);
oinches = (oin);
if(oinches==0){
alert("Please enter valid values into the boxes");
}
mainform.estimate_pool_sqft.value = oinches;
return false;
}
I have a directory on my server that I do not want Search Engines to crawl and I already set this rule in robots.txt
I do want people that have logged in to be able to have access to this directory without having to enter a password or anything.
I am thinking that a cookie is the best thing to put on users computers after they login, and if they have a cookie, they can access the directory. Is this possible, or is there a better way?
I want people without this cookie to not have access to this directory - access for members only
Any suggestions on the best design for this?
The Extjs API site adds a new tab for each search you do.
The tabs each have a red X on them to close the tab similar to what browsers have.
Check it out here:
I'd like to replicate this and it seems like something that would be built-in to the API, but cannot find it.
Any ideas?
I have some user-submitted variables that I want to display in a different part of my site like this:
<div class="pre_box">Term: </div>
<div class="entry"><?php $key='term'; echo get_post_meta($post->ID, $key, true); ?></div>
Occasionally, these variables might be empty in which case I don't want to display the label for the empty variable. In the example above I would want to hide the <div class="pre_box">Term: </div> part. Is there some simple way to check if a php variable like the one above is empty and prevent the label from being displayed?
I installed drupal-6.16.
I applied the patch from the post http://drupal.org/node/222926#comment-930745.
It works correctly in simple cases.
But for following code for counter is handled incorrectly:
<br><br>
Text
<br><br>
<!-- counter.1Gb.ua -->
<script language="javascript" type="text/javascript">
cgb_js="1.0"; cgb_r=""+Math.random()+"&r="+
escape(document.referrer)+"&pg="+
escape(window.location.href);
document.cookie="rqbct=1; path=/"; cgb_r+="&c="+
(document.cookie?"Y":"N");
</script><script language="javascript1.1" type="text/javascript">
cgb_js="1.1";cgb_r+="&j="+
(navigator.javaEnabled()?"Y":"N")</script>
<script language="javascript1.2" type="text/javascript">
cgb_js="1.2"; cgb_r+="&wh="+screen.width+
'x'+screen.height+"&px="+
(((navigator.appName.substring(0,3)=="Mic"))?
screen.colorDepth:screen.pixelDepth)</script>
<script language="javascript1.3" type="text/javascript">
cgb_js="1.3"</script>
<script language="javascript"
type="text/javascript">cgb_r+="&js="+cgb_js;
document.write("<a href='http://www.1Gb.ua?cnt=1416'>"+
"<img src='http://counter.1Gb.ua/cnt.aspx?"+
"u=1416&"+cgb_r+
"&' border=0 width=88 height=31 "+
"alt='1Gb.ua counter'><\/a>")</script>
<noscript><a href='http://www.1Gb.ua?cnt=1416'>
<img src="http://counter.1Gb.ua/cnt.aspx?u=1416"
border=0 width="88" height="31" alt="1Gb.ua counter"></a>
</noscript>
<!-- /counter.1Gb.ua -->
It modifies the string
"alt='1Gb.ua counter' /><\/a>")</a></script>
to
"alt='1Gb.ua counter' /><\/a>")</a></script>
Does anybody have this code working?
If so how this can be fixed?
Thanks a lot in advance!
Hello All,
How can I escape a ' (single quote) in JS. This is where I'm trying to use it.
<input type='text' id='abc' value='hel'lo'>
result for the above code is "hel" populated in the text box. I tried to replace ' with \' but this what I'm getting.
<input type='text' id='abc' value='hel\'lo'>
result for the above code is "hel\" populated in the text box.
How can I successfully escape the single quotes.
I want to redirect from a old url which still appears in the google search to the new one. the old url is this:
http://www.marionettecolla.org/file%20_mostra_milano/mostra_marionette-milano.htm
and I want to redirect it to the home page:
http://www.marionettecolla.org/
I used this in my .htaccess:
Redirect http://marionettecolla.org/file\ _mostra_milano/mostra_marionette-milano.htm http://marionettecolla.org/
but I am getting Error 500... Does anybody know how to solve this problem?
How could I have the tab to be on hover mode while I rollover the drop down sub-menu.
Does it require javascript or it could be done solely on CSS?
<li id="anchor" class="title dropdown"><a href="#">Main Tab</a>
<div class="column">
<ul>
<li class="subtitle">Button 1</li>
<li class="subtitle">Button 2</li>
<li class="subtitle">Button 3</li>
</div>
</li>
hello,
my main question is as follows: how to show only the first subchild of a ul or li upon clicking the enclosing parent.
eg:
<ul> Grandparent
<li> Child1 <li> Grandchild11</li></li>
<li> Child2 <li>GrandChild21</li><li>grandchild22</li></li>
</ul>
so, for example
I would like something to the effect of
<script>
$('ul').click(function(){
$('ul').children('first li').toggle()
});
$('li').click(function(){
$('li').children('first li').toggle()
});
</script>
meaning: when i click ul, i only see the first child node (child1 and child2 will be shown, but not the grandchildren). when i click child1 or child2 i see the respective grandchild.
grandchild is not shown upon clicking grandparent, only upon clicking child1 or child2.
i know i am reinventing the wheel of some pre-coded solution, but any help would be largely appreciated!
I have a form and it contains dropdown box and different div items. Based on selection from dropdown box, I show those div items. But some of the text in those div items are shown when the form is loaded and not when I select the option from dropdown box. The code is somewhat like this
<form>
<select id="">
<option value="one"> One </option>
<option value="two"> Two </option>
<option value="three"> Three </option>
</select>
<div id="onee"> header text ..<table> </table></div>
<div id="twoo"> header text ..<table> </table></div>
</form>
So when I load the page form with select drop down box is shown , but it also shows header text which is within div. How do I hide that text?
Hello everybody,
I have multi-step form and user can navigate to any page to modify or add information. There is a menu that shows progress and steps user completed. This menu allows to navigate to any step user completed or going to complete.
Inspite of big button "Save and Continue" some users click this menu to navigate further. I have to check - if values have changed in a form and ask: "Save changes? Yes/No".
What is the best way (with minimum code) you suggest me to check if form values have changed.
Thank you in advance!
I know that I can assign an onclick action to <input type="button"-style buttons. But is it possible to let it behave like an <a> without using JavaScript? I ask because I'm in a situation where technically I'm better off using <a>'s, but buttons look nicer.
Currently I have a jumbotron setup with some paragraph text, and I would like to stick a button dropdown inline with the text.
Dropdown button
<span class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Button... <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Opt 1</a></li>
<li><a href="#">Opt 2</a></li>
</ul>
</span>
Jumbotron
<div class="jumbotron">
<h1>Hello!</h1>
<p>Welcome</p>
<p>Another paragraph
<!-- dropdown is here -->
</p>
</div> <!-- jumbotron -->
If the dropdown is within the <p> tag, it does not "dropdown" (but renders). If it is outside of the <p> tag it functions fine, but I would like it to be inline with the text and need the text to be in the <p> tag to get the style. Any ideas?
Things to note -- If I replace the <span> tags with <div> tags, it will work fine within the <p> tags, but won't be inline.
Hi there,
i have a very simple question about Google Maps API.
In this case, i have on my page a map on the left, with about 40 points, and the list of these 40 points on the right.
So you know, when you click on a point of the map, the "info window" is displayed so you can see some informations about it.
I can't find how can i do to simply open the "info window" on the map, by making a "hover" on the corresponding link. (and by the way, close all the others info windows)
Did someone have an idea about this?
Thanks a lot, have a nice day! :)
What I basically want is a Colorbox (which is a lightbox clone), to have an argument which chooses different stylesheets dependant on which variable I provide.
I'm making a Javascript slideshow for my blog yet the array doesn't seem to be working.
Can someone please say what I've been doing wrong
<SCRIPT type="text/javascript">
var blog = new Array()
blog[0]= "<h4>Sunday 17 of June 2012</h4><p title='Blog'>Donec tempus risus eget ligula viverra eget placerat odio tincidunt. Duis nisl sem, scelerisque faucibus congue vitae, accumsan at lectus. Cras vestibulum arcu ut lorem luctus eu pharetra tortor ultricies. Nam iaculis orci mauris. Etiam luctus, mauris sed adipiscing ullamcorper, augue enim volutpat sem, ut sagittis ipsum nibh ac nulla. Nam ultrices, quam eget sollicitudin porta, sapien mauris pulvinar augue, posuere hendrerit erat ligula ut magna. Maecenas laoreet nisi vitae magna consectetur a mollis purus tristique. Pellentesque elementum arcu non urna convallis eleifend. Aliquam eu lorem sed risus tempus tempor. Donec malesuada velit in odio vulputate iaculis. In tristique neque quis velit posuere adipiscing. Nullam dui neque, scelerisque non egestas feugiat, pellentesque vitae mauris.</p><hr>"
and so the array continues till
function display1()
{
document.getElementById(blogShow).innerHTML( blog[0])
}
function display2()
{
document.getElementById(blogShow).innerHTML(blog[1])
}
function display3()
{
document.getElementById(blogShow).innerHTML(blog[2])
}
function display4()
{
document.getElementById(blogShow).innerHTML(blog[3])
}
function display5()
{
document.getElementById(blogShow).innerHTML(blog[4])
}
</SCRIPT>
<div id="blogShow">
<SCRIPT type="text/javascript">display1()</SCRIPT>
</div>
<div id="blogNav">
<input type="button" onClick="display2()" value="1" class="button">
<input type="button" onClick="display3()" value="2" class="button">
<input type="button" onClick="display4()" value="3" class="button">
<input type="button" onClick="display5()" value="4" class="button">
</div>
I know it's all inline and i will clean up after it works