var string1 = document.getElementById('<%=txtSearch.ClientID%>').value;
var string2 = document.getElementById('<%=HiddenFieldSearch.ClientID%>').value; ;
var pattern = '/' + string1 + '/gix';
Now, if I type in 'com' that alert box should find the first occurance of the match (i.e. computer) however the alert shows null.
Hey I needed this functionality a few weeks back and I came across these ready-made-plug-in's Multiple File Upload, Single File. I know its kinda cheating but you can disect the code to understand how it works.
Hey everyone, I'm currently updating a project that is to be honest a bit dated, Data access layer is in c# and screen tier is in vb(dont't ask me why). Anyway for validation you always need to postback to validate data an that, I have started using jquery (which is cool by the way) for validation and I have it working for general data i.e invalid lenght, characters etc...., I'm just wondering how to get jquery to connect to the db to see if say the name in the textbox already exists??
I don't get it why you need to do this in jQuery, if you already have C# in the back-end...
You would, either way, need to do a post to implement such request, and implementing it in C# is the easiest thing to do. Invoking C# action from jQuery is very easy, there are plenty of examples about it in the internet.
Was kinda thinking when the page firsts loads that I could some way store the values that were in the db and then if the user entered one of those values that jquery would present the user with a message to say this name already exists. I already have validation working for valid emails, lenght etc..
Preloading the complete list of valid values probably isn't the correct approach; for one thing, it could be quite large, and for another, do you really want users to be able to see all the values in this table?
Doing an AJAX lookup at an appropriate time (send something like checkValue?typed=whattheusertyped to a simple server-side script), i.e. when they tab out of that field or pause typing for half a second, or something like that, seems like a better solution to me.
Validation against pre-fetched values is a heavier operation than server-side validation. You should just go for the latter as a much better standard It will be one short post instead of sending a whole list of records into the browser.
Hi. I want to send XML data from a windows Gadget to a aspx.net server. What is the best way to do it?
This is what i have so far, thank you
PS: I can't use submit forms. My gadget disapears and a small white square shows up instead.
You seemed to have missed the concept of this site.
The usual modus operandi on CP is that somebody who has an issue with something programming related, posts a message describing the problem in detail and what they already tried and so on. The CP members then try to assist the poster to resolve the issue.
If you think you know enough about that topic write an article and publish[^] it here on CP.