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?
Hi, further to a previous question, I have this code:
{textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';"}
And I want the output to be
<textarea onblur="if(this.value=='') this.value='Skriv her';" onfocus="if(this.value=='Skriv her') this.value='';">Write here!</textarea>
I tried [/textarea} but it didn't work in my template file.
Is it possible to make this in smarty/php?
Thanks :)
I have a J2EE application that I am building with Spring and Maven. It has the usual project structure. Here is a bit of the hierarchy.
MyApplication
src
main
webapp
WEB-INF
layout
header.jsp
styles
main.css
I want to include that CSS file in my JSP. I have the following tag in place.
<c:url var="styleSheetUrl" value="/styles/main.css" />
<link rel="stylesheet" href="${styleSheetUrl}">
When I deploy the application, the CSS page isn't being located. When I view the page source, the href is /MyApplication/styles/main.css. Looking inside the WAR, there is a /styles/main.css. However, I get a 404 when I try to access the CSS file directly in the browser.
I discovered that the reason for the issue was the Dispatcher Servlet mapping. The mapping looks as follows.
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
I imagine the Dispatcher Servlet doesn't know how to handle the CSS request. What is the best way to handle this issue? I would rather not have to change all of my request mappings.
/* Style 1 */
.myclass {
background:#ff0;
border:1px solid #ff0
}
#myid {
width:80px;
height:80px;
}
/* Style 2 */
.myclass { background:#ff0; border:1px solid #ff0 }
#myid { width:80px; height:80px; }
I'm sure there must be more styles for writing CSS, I'd like to know what are they. Is there an article already written that lists all styles.
Thanks
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?
We have a long page that contains a bunch of different form elements. One part of the form is called remotely via AJAX and is populated in an empty div. This is the part which JQuery Validation plugin is not working correctly on.
We have class="required" on the elements on this page, but they do not show up as required. I'm guessing it's because the Validation plugin is looking for class="required" on our main page, and since the content from the AJAX page is put into the empty div behind the scenes, it's not detected the required fields.
Any help is greatly appreciated.
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! :)
Hello friends,
I have a JSP page on which I have a div tag in which there is a a IMG tag. Using this IMG tag I want to show an image in it. Here the source path of an image is comes from database so I assigned a JSP variable using JSP scriplet. This JSP variable have the source path of an image.
This path of image may be of different machine or of same machine i.e. images are stored on different machine or on same machine i.e. on local machine on different drive.
The problem is that how to give path of image stored on different machine as well as on same machine. I have tried different ways like by giving ip address of that machine.
Here is the path that of local machine where the image is stored
img src= file:\localhost\D:\ScannedSheets\testproj/batch1/IMG001.jpg style="z-index:1; position:absolute; top:0; left:0; width:850; height:1099"
With this syntax the image is visible in Internet Explorer but With the same syntax Its not visible in FireFox, Google Chrome etc.
Please Guide me in friends.
Also tell me that how to give path of the image stored on different machine which works In Internet Explorer, FireFox, Google chrome etc.
I have an object list being loded from a database to a drop down list. The Model loads the data to the Controller. The aspx view includes an ascx view. The ascx view already inherits data from another Project. I cannot set my List object in the ascx page. Can this be done?
Model
...
string List = dr["example"].ToString().Trim();
int indicator = dr["ex"].ToString().Trim();
LossCauseList.Add(new LossCauses(indicator, List));
...
Controller
LossCauses test = new LossCauses();
test.GetLossCauses(LossType);
TempData["Select"] = test.LossCauseList;
return View(myData);
Partial View
...
<select id="SelectedProperty">
<% List<string> selectProperty = new List<string>();
selectProperty = TempData["Select"] as List<string>;
foreach(var item in selectProperty) { %>
<option><%=item.ToString() %></option>
<% } %>
</select>
...
Partial view's List should be an actual LossCauses object. HELP!!!
Hi all,
I'm quite new to drawing shapes, graphics, bitmaps etc. I googled for a few days,but still havent got a real clue what to do, so please help me:
I want to draw a floorplan with certain objects(represented as circles) moving on it.
When I click on a object, it needs to show something.
So far, I ve been able to draw some circles on a graphic and been able to move the dots by clearing the graphic every time. Ofcourse, this isnt a real solution, since I cant keep track of the different objects on the floorplan (which i need for my clickevent and movings).
I hope I explained my problem ok here.
This is the (stripped version of the) sourcecode that gets called every second:
(dev (of type Device) is the object i want to draw)
Graphics gfx = FloorplanTabPage.CreateGraphics();
gfx.Clear(Color.White);
foreach (Device dev in _deviceList)
{
Pen myPen = new Pen(Color.Black) { Width = 10 };
dev.InRoom != null)
{
myPen.Color = Color.DarkOrchid;
int x = dev.InRoom.XPos + (dev.InRoom.Width / 2) - 5;
int y = (dev.InRoom.YPos + (dev.InRoom.Height / 2) - 5;
if (dev.ToRoom != null)
{
x = (x + (dev.ToRoom.XPos + (dev.ToRoom.Width / 2)) / 2;
y = (y + (dev.ToRoom.YPos + (dev.ToRoom.Height / 2)) / 2;
}
gfx.DrawEllipse(myPen, x, y, 10, 10);
gfx.DrawString(dev.Name, new Font("Arial", 10), Brushes.Purple, x, y - 15);
}
}
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.
<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..
Here is a sample of my database search code:
Dim sql As String = "Select * From Table Where "
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim andor As Boolean = AndOr1.SelectedValue 'selection can be AND or OR (0 / 1)
'Code for when the user selects AND
If NameSearch.Text.ToString IsNot String.Empty And andor = 0 Then
sql += "Surname LIKE '%" & name & "%' AND "
End If
If EmailSearch.Text.ToString IsNot String.Empty And andor = 0 Then
sql += "Email LIKE '%" & email & "%' AND "
End If
If CitySearchBox.Text.ToString IsNot String.Empty And andor = 0 Then
sql += "City LIKE '%" & city & "%' AND "
End If
'Code for when the user selects OR
If NameSearch.Text.ToString IsNot String.Empty And andor = 1 Then
sql += "(Surname LIKE '%" & name & "%' OR "
End If
If EmailSearch.Text.ToString IsNot String.Empty And andor = 1 Then
sql += "Email LIKE '%" & email & "%') OR "
End If
If CitySearchBox.Text.ToString IsNot String.Empty And andor = 1 Then
sql += "(City LIKE '%" & city & "%' OR "
End If
sql = CleanString(sql)
End Sub
When the user selects AND (as andor.selectedvalue(0)) then the sql is produced fine like this;
Select * From Table Where Surname LIKE '%test%' AND Email LIKE '%test%' AND City LIKE '%test%'
But if the user selects OR (as andor.selectedvalue(1)), nothing is outputted except;
Select * From Table Where
Im sure the controls have values so are not string.empty and when the user selects OR the correct value 1 is being assigned to andor.
I cannot make the image a background image to a div and round the div's corners because the image is resized, and as far as I know, you cannot resize a background image.
What are my options, if any? Open to all suggestions including wrapper divs and corner images.
Also, if it cannot be done in IE but there's a solution for Firefox, that's just fine with me.
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 want to create a banner scrolling function for my homepage. I am not too sure of which programming language to use here. I want to code something similar to: http://www.squidfaceandthemeddler.com/. But I want the footer to remain at the same position while the user scroll the table. Is it possible to get that result? I have create a simple tables and 2 images for the user to click on
here is my code for the tables:
<div id="banner" style="height:750px; width:600px; overflow:scroll;" >
<table width="750px" height="600px">
<tr>
<td><a href="sale_1.php"><img src="banner1.png"/></a></td>
</tr>
</table>
<table width="750px" height="600px">
<tr>
<td><a href="sale_2.php"><img src="banner2.png"/></a></td>
</tr>
</table>
<table width="750px" height="600px">
<tr>
<td><a href="sale_3.php"><img src="banner3.png"/></a></td>
</tr>
</table>
</div>
and this is the upwards and downwards button for the scrolling:
<table width="750px" height="30px">
<tr>
<td align="right"><img src="images/up_arrow.png"/><img src="images/down_arrow.png"/></td>
</tr>
</table>
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.
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 am making a website in Adobe Dreamweaver with php. In the site there’s a 3 buttons for selecting payment method that will act as the continue button. What I want is when the user checks a radio buttons (I agree button), it will be add with that amount and display with previous amount.. there is three buttons which has the corresponding values(amount in pounds)..
plz check my website http://www.spsmobile.co.uk in this linkgo to mobile phone unlocking and after add the cart click make payment it will go to next page there is a delivery mail details.. for that delivery mail details only am asking..
here i mentioned code:
<input id="radio-1" type="radio" name="rmr" value="1">
<label for="radio-1">£3</label> <input id="radio-2" type="radio" name="rmr" value="2">
<label for="radio-2">£5.5</label>
<input id="radio-3" type="radio" name="rmr" value="4">
<label for="radio-3">£10</label>
<div class="total-text" style="font-size:36px">£10</div>
var total = parseInt($("div.total-text").text().substring(1), 10);
$("input[name='rmr']").bind('change', function() {
var amount = 0;
switch (this.value) {
case "1":
amount = 3;
break;
case "2":
amount = 5.5;
break;
case "4":
amount = 10;
break;
}
$("div.total-text").text("£" + (total + amount));
});
but there is no change , my previous amount did not add with that. while am clicking previous amount only displayed on browser.. i need when i cliks radio button the value should change correspondingly.. where i did that mistake...plz give me some idea and what should i do..is there any need for storing db..
thanks in adv
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?
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
I'm having a bit of trouble with dynamic_casting. I need to determine at runtime the type of an object. Here is a demo:
include
include
class PersonClass
{
public:
std::string Name;
virtual void test(){}; //it is annoying that this has to be here...
};
class LawyerClass : public PersonClass
{
public:
void GoToCourt(){};
};
class DoctorClass : public PersonClass
{
public:
void GoToSurgery(){};
};
int main(int argc, char *argv[])
{
PersonClass* person = new PersonClass;
if(true)
{
person = dynamic_cast(person);
}
else
{
person = dynamic_cast(person);
}
person-GoToCourt();
return 0;
}
I would like to do the above. The only legal way I found to do it is to define all of the objects before hand:
PersonClass* person = new PersonClass;
LawyerClass* lawyer;
DoctorClass* doctor;
if(true)
{
lawyer = dynamic_cast(person);
}
else
{
doctor = dynamic_cast(person);
}
if(true)
{
lawyer-GoToCourt();
}
The main problem with this (besides having to define a bunch of objects that won't be use) is that I have to change the name of the 'person' variable. Is there a better way?
(I am not allowed to change any of the classes (Person, Lawyer, or Doctor) because they are part of a library that people who will use my code have and won't want to change).
Thanks,
Dave
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>
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?
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?