Hi,
I wrote a AS3 script, i have 2 fields to validate, i.e email and name.
For email i use:
function isValidEmail(Email:String):Boolean {
var emailExpression:RegExp = /^[a-z][\w.-]+@\w[\w.-]+.[\w.-]*[a-z][a-z]$/i;
return emailExpression.test(Email);
}
How about name field? Can you show me some sample code?
EDIT:
Invalid are:
blank
between 4 - 20 characters
Alphanumeric only(special characters not allowed)
Must start with alphabet
I'm using Zend_Navigation to create my nav. I want the URL to be domain.com/me and not domain.com/index/me. What is wrong with my config XML:
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<home>
<label>Home</label>
<controller>index</controller>
<action>index</action>
<pages>
<me>
<label>Me</label>
<module>default</module>
<controller>index</controller>
<action>me</action>
<resource>user</resource>
<privilege>logout</privilege>
</me>
</pages>
</home>
</nav>
</config>
My send mail task works fine for email ids like [email protected] but it throws error for email ids like [email protected].
is there any way i can make it work for such ids also?
Thanks.
I have a model like this:
class MyModel(models.Model):
REGULAR = 1
PREMIUM = 2
STATUS_CHOICES = ((REGULAR, "regular"), (PREMIUM, "premium"))
name = models.CharField(max_length=30)
status = models.IntegerField(choices = STATUS_CHOICES, default = REGULAR)
class MyForm(forms.ModelForm):
class Meta:
model = models.MyModel
In a view I initialize one field and try to make it non-editable:
myform = MyForm(initial = {'status': requested_status})
myform.fields['status'].editable = False
But the user can still change that field.
What's the real way to accomplish what I'm after?
Hi
What is the difference between a abandon Session and a cookie timeout, what if the session is abandon and the cookie is still alive, is that can lead to a problem?
<sessionState timeout="1" />
<authentication mode="Forms">
<forms loginUrl="login.aspx" timeout="1" />
</authentication>
Thanks
Hi
I have a submit button and am styling it using the following css:
.subm
{
background-color:Transparent;
background-image:url(Images/Button_Send.png);
background-repeat:no-repeat;
width:82px;
height:30px;
display:block;
border:none;
outline:none;
overflow:visible;}
.subm:hover
{
background-color:Transparent;
background-image:url(Images/Button_Send_Over.png);
background-repeat:no-repeat;
width:82px;
height:30px;
display:block;
border:none;
outline:none;
overflow:visible;
}
Here is the html:
<input type="submit" class="subm" value="" />
Nothing surprising. However, what annoys me is that when the submit button is clicked in IE it moves the image up a couple of pixels cutting them off which makes it look, hmm, good word, 'naff.' How can I compensate or stop this?
I have tried expanding the image and leaving a couple of blank pixels at the top but it still does the same thing!
Thanks R.
Hi, We have a similar problem. We have a web application running under default appdomain. It was working fine until a week before...Suddenly it has encountered a problem. Below message is taken from event logs.
Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
Application uses FormsAuthentication and gets the roles from aspnetdb.. After the error, when user logins to the page, it does not redirects to the default.aspx. Again login.aspx comes up. On the other hand application works fine on development server(localhost), but not on www(IIS 6.0).
Does any one has an idea?
Thanks,
Ilknur
Hi, I want to create an html page inside a asp.net page using c# and then request that html page. The flow is, I'll be creating a request that will give me a response with some values. Those values will be stored in hidden fields in the html page I'm creating on the fly and then requesting. I figure it would be something like below but I'm not sure if it would work, I've also received some "Thread Aborting" errors. So, does anyone know the proper way to do this or at least direct me to a nice article or something?
StringBuilder builder = new StringBuilder();
builder.Append("<html><head></head>");
builder.Append("<body onload=\"document.aButton.submit();\">");
builder.Append("<input type=\"hidden\" name=\"something\" value=\"" + aValue + "\">");
HttpContext.Current...Response.Write(builder.ToString());
... end response
I downloaded these zip files from the link http://netbeans.org/downloads/zip.html with the hope that this way I will have a fine grained control over the installation process.
But I stand clueles. I can't tell how to install Netbeans from these, there is no installation guide for this.
Any ideas how to install Netbeans this way.
hai am develping a application in c#(WPF). when i run the application in windows xp, i want to show windows like how we look in windows 7 or in vista.. am using WPF with c#. is it possible. how can i do
Hi All
I've just started using WPF. But I'm trying to add my code that (from Winforms) enables the user to drag any control whereever they wish at runtime. But I can't seem to get the current Location of the mouse... Eh? There is no Location for Mouse? :(
For winforms applications I'm wondering what setup code should go in:
MainForm()
as opposed to
MainForm_Load(object sender, EventArgs e)
Are there any best practice guidelines here?
In order to transfer text from one textbox to another, I have created a submit button. However it would be preferable to use the functionality of the 'enter' key.
I am not sure but i think the ascii code is 13.Anyway how do I go about this task at hand?
I am using asp.net mvc and jquery to make ajax requests and when the session times out after an ajax request the full sigin page gets loaded into my ajax div.
How can I display a modal popup instead of making a redirect when a session times out?
Inside a grails application, I need to upload a file under web-app/js, add a prefix, and put it in S3. I'm having trouble figuring out how to read the js file in a way that will work in development (/web-app/js) and production (/js). I'm doing this from inside a domain object.
Following is the code to populate combobox using DataSource
Dim CountryList As Array = MyCtrl.GetAllCountries
With cbCountyList
.DataSource = CountryList
.DisplayMember = "CountryName"
.ValueMember = "CountryID"
End With
After adding a new COuntry Name to Database I want to reflect the changes in combobox. Repeating this code is not an option becasue it triggers SelectIndexChange event and had to do some crappy work around to avoid that.
So I was wondering if there is way to refresh the combobox list. I actually thought binding with the DataSource property supposed to do it automatically. I also tried
cbCountyList.Refresh()
Thanks in advance.
I have some data in db,now i m making them to display in the front end so,i ii have a update button,if i click it the selected values to come to database
http://dpaste.com/hold/180761/
Thnx in advance.
Introduction:
I want to loop through XML files with flexible categories structure.
Problem:
I don't know to loop through a theoretical infinte subcategories without having to make x amount of "for each" statements (See coding example in the bottom). How do I dynamically traverse the categories structure?
What I have now:
I have no problem looping through XML files with a set structure:
<catalog>
<category name="Category - level 1">
<category name="Category - level 2">
<category name="Category - level 3" />
</category>
<category name="Category - level 2">
<category name="Category - level 3" />
</category>
</category>
</catalog>
Coding example:
//$xml holds the XML file
foreach ( $xml AS $category_level1 )
{
echo $category_level1['name'];
foreach ( $category_level1->category AS $category_level2 )
{
echo $category_level2['name'];
foreach ( $category_level2->category AS $category_level3 )
{
echo $category_level3['name'];
}
}
}
I'm playing around with Symfony and have encountered a road block.
I created a model "CmsPage" which has a field called "content" which is stored as a clob (this is specific to doctrine I believe). When I created the app I set "--escaping-strategy=on" so if I enter any html when editing a CmsPage that gets encoded with html entities or something along those lines. I would like to allow html in this field and a quick googling hasn't helped much. Maybe I'm searching for the wrong terms.
Anywho I would like to disable character escaping for this field and possibly only allow a small selection of html tags. What is the correct way to do this in Symfony?
I have created a view in which i`m using clientsidevalidation.
The jquery has a textbox , a table and a submit button. The table is empty at the beginning.
Using jquery I populate the table with 2 columns ID and Name.
I send the values to the controller using the submit button.
My question are as follows:
How do I send the values of the texbox and the table to the controller?
Any guide please.
I am working on and Microsoft MVC3 project and cannot pass a parameter which has been edited to the controller. It will only pass back the original set parameter
For example:
@Ajax.ActionLink("share file", InviteController.Actions.Result, InviteController.Name, new { message = Model.Message }, new AjaxOptions
{
HttpMethod = "GET",
UpdateTargetId = "popup",
OnSuccess = "$('#popup').dialog('open')"
}, new { id = "popup-button" })
<label>Personal Message <span class="optional-message">(optional)</span></label>
@Html.TextAreaFor(x => x.Message)
</div>
This will pass the to the following controller but the 'message' parameter has the original message and not the updated message:
public ActionResult Result(FormCollection coll, string message)
{
I'd love if someone could give me some advice.
Many Thanks
I have a file containing data as follows
10 20 30 40 70
20 30 70
30 40 10 20
29 70
80 90 20 30 40
40 45 65 10 20 80
45 65 20
I want to remove all subset transaction from this file.
output file should be like follows
10 20 30 40 70
29 70
80 90 20 30 40
40 45 65 10 20 80
Where records like
20 30 70
30 40 10 20
45 65 20
are removed because of they are subset of other records.
hi all...
i want to post a string to the facebook wall from my iphone app like.. sharing the status in facebook.
presently i am doing like..when i press a button after logging in, i am getting a webview with the string i want to post and with buttons 'post' and 'cancel'.
but i want like.. when i click the first button only(after logging in, with out the facebook webview) the string should be posted to the wall.