|
I have to validate text entered in a TextBox with the value in a table ie a value stored in a Database.
Pls give me snippet of code how it can be done using AJAX
|
|
|
|
|
Have you tried googling around?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hi,
Is the validation you are performing a straight text comparison, or should the entered text match one of several values pulled from the database?
As you are using AJAX, if you want the validation to fire when the TextBox loses focus, then the best way to do this would be to write a custom handler that, when fired on the onblur event of the TextBox, calls a local web service that is passed the entered text. The web service can then perform some server-side validation against the database and pass back the result. If the entered text is invalid, use JavaScript to display an error icon, or whatever element is being used for validation errors. If you are using .Net 2.0 or higher then the use of the ScriptManager control to create JS web service proxy objects, makes this operation very simple.
If validation only needs to be run when the form is posted back then it would be simpler to use a custom validation control and validate the entered text when the page is posted. You simply need to put your validation logic in the server-side ServerValidate event of the custom validation control.
Hope this helps...
Clean code is the key to happiness.
|
|
|
|
|
Dear all,
I have a serious problem that can't resolve.
The problem are:
1- I cann't integrate Drupal into Moodle System. (big problem)
2- But i can intergrate Moodle into Drupal System. (It's ok)
The reason i want to integrate Drupal into Moodle because
i want Moodle as a main system of Drupal.
The structure is "Drupal in Moodle.".
Please help soon.
Thanks,
Best regards,
Han
|
|
|
|
|
You might want to look on moodle's site.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
var doc = new ActiveXObject("Word.Application");
doc.Visible=false;
doc.Documents.Open("C:\\users.doc");
var txt;
txt = doc.Documents("C:\\users.doc").Content;
alert(txt);
doc.quit(0); // quit word (very important or you'll quickly chew up memory!)
i am getting error : automation server can't create object
modified on Friday, January 25, 2008 4:36:59 AM
|
|
|
|
|
ritu4321 wrote: i am getting error
There is an error number also yes? Look it up in the documentation. It will provide more detailed information.
led mike
|
|
|
|
|
Hai,
pls give me an idea of how to call multiple functions on clientside
for eg:
My code is like this
<asp:button id="btnSave" runat="server" borderstyle="Groove" onclick="btnSave_Click">
Text="Save" OnClientClick="val(); " />ie OnClientClick how can i call multiple functions
|
|
|
|
|
Hi,
This can be easily achieved by either calling a single JS function that will then call all the functions you require, or by simply separating calls with a semi-colon e.g.
<asp:button id="btnSave" runat="server" onclick="btnSave_Click"
Text="Save" OnClientClick="fn1(); fn2(); fn3();" />
or
<asp:button id="btnSave" runat="server" onclick="btnSave_Click"
Text="Save" OnClientClick="clickFn();" />
in your JS file...
function clickFn()
{
fn1();
fn2();
fn3();
}
Clean code is the key to happiness.
|
|
|
|
|
Hai,
Could you pls give me an idea that how to call a javascript function on PageLoad
|
|
|
|
|
Hi,
There are a couple of ways to do this, as there are a number of DOM events that you can hook into. My preferred method is to attach functions to the window.onload event. This can be done as follows:
function myOnloadFunction()
{
// Add your page load JS here
}
function addEvent(obj, type, fn)
{
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent)
obj.attachEvent("on" + type, fn);
}
addEvent(window, "load", myOnloadFunction);
The above example provides a cross-browser solution for attaching events to DOM elements.
Clean code is the key to happiness.
|
|
|
|
|
Hi there,
i have a website
Files hierarchy is
wwwroot/
Default.aspx
Login.aspx
data/
db1.mdb[MS Access database]
web.config
Register/
Signup.aspx
web.config
when i inserting a record from Signup.aspx to db1.mdb it was returning an error Operation must use an updateable query
i think i have to change the permissions of db1.mdb, if so how to change permissions. iam using windows xp operationg system.
thanks for any advice
|
|
|
|
|
I have an old website with a client who wants all of the sercurity holes closed. One of them is that there are many cookies not set with the HttpOnly option.
I have tried to set them according to the documentation I have found online for ASP, example:
Response.Cookies( "TestCookie" ).Path = "/; HttpOnly"
Response.Cookies( "TestCookie" ) = "This is an HTTP Only cookie"
yeilds a blank cookie when accessing it from another page. I have tried this on different computers and get the same result.
I think I found the problem though. The cookie header is being sent like this (output from Fiddler2):
Set-Cookie: TestCookie=This+is+an+HTTP+Only+cookie; path=/%3B%20HttpOnly
If I set the cookie using the .HttpOnly property of the cookie object in a .Net application I get:
Set-Cookie: TestCookie=This is an HTTP Only cookie; path=/; HttpOnly
Which works just fine.
Looks like the cookie header is getting escaped somewhere, anyone have any ideas?
Thanks in advance for any help.
|
|
|
|
|
I've put together a web page for a client and for the menu, actual restaurant menu, I've used a vbscript function to create an interchanging IFrame set. The problem that I'm running into is that when the client tries to view the menu a warning message appears in the browser warning that the page runs dynamic content that could be harmful to the computer. Since this is not the case I would like to know if there is a way to work around this or if this is the result of the security settings in IE.
Thanks,
An American football fan -
Go Seahawks!
Lil Turtle
|
|
|
|
|
It is likely a security thing in IE...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
If you view the web page from the local file system, you get a warning about this. The warning doesn't come up when the page is hosted on a server.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thank you for the reply, I had not loaded the project files to the host server due to the error that was coming up, but I will give it a go now.
Thanks again.
An American football fan -
Go Seahawks!
Lil Turtle
|
|
|
|
|
Hello,
I am beginner in PHP and using Wampserver for Apache, PHP and MySql.
I created two file first.php and second.php
In first.php i have two text box trough which user can enter data and this first.php call second.php with method = "post" for database access.
In second.php i am not getting values of textboxes using $_POST variable.
Please help me why i m not getting value.
Thanks
Vipin
|
|
|
|
|
It is important to make sure PHP is working on your webserver.
What output are you getting?
Here is an example which should work:
1. first.php
<br />
<form method="post" action="second.php"><br />
<input type="text" name="field1" /><br />
<input type="submit" value="Send data" /><br />
</form>
2. second.php
<?PHP <br />
print_r($_POST);<br />
?>
Good luck
|
|
|
|
|
Hello, I was wondering how to go about - (without having others have to add my site to their trusted sites) - having the information bar which protects against crazy's scripts, not to show up, and to have MY scripts, work for others (potential clients of my WebSite's services), without even having the information bar displayed. Allowing them to experience my WebSite without having to answer the bar and get paranoid, not to mention have my site not display properly.
I would be very greatful,
Robert I Mercer
|
|
|
|
|
salam guys,
I have a small problem with ma web application, i send some fields to the server i get the values on the server then i store them in the DB.
the page come back from server with empty fields(of course), but when i refresh the page(with empty fields), the last values i sent to the server go again to this laller after the refresh & they get stored in the DB
i hope you understood me,is there any way to empty them ?? & why the values go again even with empty fields ??
try to be good if you can't be the best
|
|
|
|
|
Sounds like you need to reorganise your page so that values aren't saved on every postback. What technology are you using?
|
|
|
|
|
Salam, thnx man for your answer & solved the problem , i'm using php thank you very much man i appriciate your help
salam
try to be good if you can't be the best
|
|
|
|
|
I have a Frames page. Inside one of the frames is a page with a form and an iFrame. On this page upon page load I post the form to the iFrame. Two problems happen in FireFox, but not in IE:
1) FireFox constantly shows a "refreshing" status i.e. if you hover the mouse near the menus on top, it constantly shows the hourglass.
2) Refresh the page in Firefox. First it gives a warning "The page you are trying to load contains POSTDATA. If you resend the data, any action the form carried out (such as a search or online purchase) will be repeated. To resend the data click OK. Otherwise, click Cancel."
And then it loads the contents of Frame 2 inside Frame 1.
Is there any solution to this problem? What am i doing wrong?
If anyone can help, I will be very grateful.
Thanks
Here is the code:There are 4 pages.
Main.asp:
<%@ Language=VBScript %><%
OPTION EXPLICIT
Response.Buffer = true
Response.Expires= -1
%>
<html>
<head>
<title>
</title>
</head>
<frameset cols="50%,50%">
<frame src="dummy.htm"></frame>
<frame src="A.asp"></frame>
</frameset>
</html>
dummy.htm:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY bgcolor="#E6E6E6"><P> </P></BODY>
</HTML>
A.asp:
<%@ Language=VBScript %><%
OPTION EXPLICIT
Response.Buffer = true
Response.Expires= -1
%>
<html>
<head>
<title>
</title>
<script language="javascript">
function init(){
document.form1.action = "B.asp";
document.form1.target = "F1" ;
document.form1.submit();
}
</script>
</head>
<body onload="init();">
<form name="form1" method="post">
<iframe name="F1" src="dummy.htm"></iframe>
</form>
</body>
</html>
B.asp:
<%@ Language=VBScript %><%
OPTION EXPLICIT
Response.Buffer = true
Response.Expires= -1
%>
<html>
<head>
<title>
</title>
</head>
<body>
This is B.asp
</body>
</html>
Please help.
|
|
|
|
|