|
Hi
Hope someone can help with this as I'm feeling a bit stupid at the moment!
I've got a form (using a master page and an update panel in case it's relevant). This is also (and unfortunately needs to) running in IE6.
On there are 3 text boxes which are pre-populated server side. When the value of one of these changes, I need to update another part of the screen (client-side, this doesn't need to go back to the server). So, each of those text boxes has:onFocus="storeValue(this)" onBlur="leavingField(this) so that on entry to the field the value is stored in a global variable and on exit this is checked and actioned if it has changed. The first time you enter and exit a field it behaves as expected, subsequently you get a 'Function Expected' error.
The relevant code is:
var valStore;
function storeValue(field) {
valStore = field.value;
}
function hasValueChanged(val) {
if (val != valStore)
hasValueChanged = true;
else
hasValueChanged = false;
}
function leavingField(field) {
if (hasValueChanged(field.value)) {
var prefix = (ctlPrefix + curr);
calculateSingleDifference(field.id.split(prefix)[1]);
field.className = (field.className + ' changedValue');
}
}
The error is raised the second time 'hasValueChanged' is called in 'leavingField'.
Any ideas gratefully received!
Thanks in advance
Ben
|
|
|
|
|
Bjohnson33 wrote: function hasValueChanged(val) {
if (val != valStore)
hasValueChanged = true;
else
hasValueChanged = false;
}
well, to start with you got hasValueChanged both as function name and variable name. I can see where that originrated
try this for a size,
function hasValueChanged(val) {<br />
if (val != valStore)<br />
return true;<br />
else<br />
return false;<br />
}
|
|
|
|
|
Thanks Yusuf, exactly right - was obviously having a syntax meltdown - fifth language this week!
Ben
|
|
|
|
|
Hi,
I want to make a Quick Search Text box in my site. User can enter anything in quick search textbox and press the search button.
I want to populate my gridview with any product which has a word which the user entered in the text box.
For example if the user enters black in the textbox to search, I want to show
all black products like black pen, black book, black umbrella etc. It will be like a search button using SQL Server database.
could you please help me to set up this?
Thanks
modified on Friday, May 15, 2009 2:46 AM
|
|
|
|
|
CHANDUA wrote: It will be like a search button.
Except it will be quicker.
Where is your data coming from?
|
|
|
|
|
SELECT * FROM your_database_table WHERE Name = '%ENTERED_TEXT%'
That should get the info from the database. Dont forget the percent symbols - they will get anything that is simlar to the entered text.
If you are unsure what to do with this I suggest you google "asp c# sql tutorials" (I presume you are using asp & c# - if not replace this with the technology you are using) or hire a web designer.
|
|
|
|
|
Hi all,
Have created and published a website which has then been installed to a virtual directory using IIS.
However, when I try to get access to the default.aspx page through IE, I get a 'page not found' error. Its the same for every page which was included in the site, there are only 3.
I created a test.txt file in the same directory as the website after installing through IIS, and I can get access to this through IE using the website's IP. Nothing appears through localhost, not any of the web pages nor test.txt. I can't even get a directory content listing to display.
Anyone know what I've forgotten to do and would like to tell me please?
Thanks in advance.
Scott
|
|
|
|
|
sounds like a permission issue have you checked the directory permissions?
|
|
|
|
|
<HTML>
<script Language="javascript">
function printfile()
{
window.frames['objAdobePrint'].focus();
window.frames['objAdobePrint'].print();
}
</script>
<BODY>
<iframe src="Test.pdf" id="objAdobePrint" name="objAdobePrint" height="250" width="100%" frameborder=0></iframe><br>
<input type="button" value="Print" onclick="javascript: printfile();">
</BODY>
</HTML>
the above code working in Firefox browser, but its not working in safari browser.
if i try to print this pdf file in safari browser i am getting empty page print out.
if i open any pdf file in firefox browser, i can print that pdf file from toolbar File->Print option,
but its not working for safari browser.
any one can help me for above issue?
|
|
|
|
|
Hello,
I am new to the forum and am seeking some advice about my website redesign.
We are creating an ASP.NET site with a sql backend. Our site is a heavily content-based site. We are looking to have an English and Spanish site. Ideally, I would like all the content to be stored in a separate file or db.I have read a few articles about localization but still have some unanswered questions.
My questions are as follows:
1. Considering that most of our content is comprised of many paragraphs, what is the best method to store the content? Is it best to use sql db rather than xml to store text? (I have seen arguments for both and am leaning toward sql db.)
2. Will there be significant delays with displaying content given the fact that the site is such a heavily content-based site?
Thank you in advance for your suggestions and input.
Allison
|
|
|
|
|
Seems you are building some kind of CMS (Content Management System), anyway in such cases where you store too much paragraphs and they are localized I think you should go toward database. If you designed the app very well and took in consideration all minor details trust me performance will eliminate it self on the spot. having Xml is something horrible for large texts that you will have to live with through the development and maintenance life cycles of the your app.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
Hi, I have a login page with a asp:Login control. and i want to populate a session variable with the userid if logged in the user.
here is what is have.
Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles Login1.LoggedIn
Dim m As MembershipUser = Membership.GetUser()
Dim UserID As String = m.ProviderUserKey.ToString()
session("userid") = userid
End Sub
and i get this error
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 27:
Line 28: Dim m As MembershipUser = Membership.GetUser()
Line 29: Dim UserID As String = m.ProviderUserKey.ToString()
Any help
|
|
|
|
|
Hi there,
Why would you use the ProviderUserKey property to get the user name ?! you can simply use the UserName property to get it.
And try making sure which object is null ? is it the returned MembershipUser object or the ProviderUserKey, my guess is ProviderUserKey.
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
Hi,
I am either looking for a Javascript function, or a regular expression that I can use in Javascript. I have been struggling to get mine to work, so I am asking if someone can please help me write a function.
What it must do is to allow only 3 decimal places. While I type the textbox must be validated. Something like 123.456 is valid. It should not allow anything after .456 It must accept a number or a float.
It must also allow a - and a +.
This is what I currently have (but it accepts lots of decimals):
var regex = /^(\d|-)*\.?\d*$/;
Please can someone help?
Thanks
Brendan
|
|
|
|
|
Hi Brendan,
This might help:
^[-+]?[0-9]\d{0,2}(\.\d{1,3})?$ - this will allow numbers like 1, -1.1, 123.456 but not 1234.234, 123.4567 or 1234.4567.
^[-+]?[0-9]\d{2}(\.\d{3})?$ - this will only allow numbers like 123.456 or -123.246.
I hope this helps.
Ryan
|
|
|
|
|
Thanks Ryan, I will check it out soon. Just another question:
RyanMorris wrote:
but not 1234.234, 123.4567 or 1234.4567.
What's wrong with 1234.234?
You don't by any chance have some formatting script that when the textbox looses its focus that it formats the numbers to something like 1234.560 even if 1234.56 was typed in? I want it to be formatted to 3 digits. 123 becomes 123.000, 123.4 becomes 123.400 etc.
Does the above regular expressions accept only digits?
|
|
|
|
|
Hi Brendan,
.NET Enthusiast wrote: What's wrong with 1234.234?
Sorry, I think I slightly misunderstood your question, I thought you wanted 3 digits each side of the decimal place. If that's not the case then you might want to try this instead:
^[-+]?\d+(\.\d{3})?$ - this will allow you to have as many numbers as you like in front of the decimal place but only 3 after it.
To be honest I wouldn't have a clue how to reformat the number after losing focus on the text box, my javascript isn't very good. Sorry.
All the expressions I've given you only except numbers.
Thanks,
Ryan
|
|
|
|
|
hi,
Please let me know how can i Create an Application name in Application settings under HomeDirectory tab(or Virtual Directory tab)
and Set Execute Permissions ,Application protection..
and also how can i do Application Mappings under HomeDirectory-->Configuration Tab...
using adsutil.vbs...
Please help me regarding the same....
|
|
|
|
|
I know a smart guy called Google, he thinks your answer is this[^]
|
|
|
|
|
Hi,
I have a frameset based site I am modifying for a friend.
In one of the frames, in an block, I have an onClick handler assigned like so :
onClick= "window.parent.forumButtonClicked();"
In IE7/8 this works fine : I click on the image in the frame and it calls the function defined in the "master" page (index.htm).
But in Safari Beta 4, this does work. I have debugging enabled in Safari, but get no error message.
Ideas ? Is using "window.parent" not strictly W3c compliant here ?
I assume I'm going to have use some other way of referring to the enclosing master page ?
thanks !
Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
I am creating my own rich text editor, just can't use the free ones out there.
Having trouble to insert the InsertHorizontal Rule in the text area. Please help me!!
thanks in advance!
lin
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <br />
<br />
"http://www.w3.org/TR/html4/loose.dtd"><br />
<html><br />
<head><br />
<LINK REL=StyleSheet HREF='TestDrop.css' TYPE='text/css'><br />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><br />
<script language='text/javascript'src='toggle.js'></script><br />
<title>Testing</title><br />
</head><br />
<body><br />
<div><br />
<a id="lame" href="#" ><img id="test" src="images/tbl_expand.gif" onclick="beg()" /> </a><br />
</div><br />
</body><br />
</html>
This is the html file.
function beg()<br />
{<br />
var toggle ='on'<br />
var obj = document.getElementById('test')<br />
<br />
EC();<br />
<br />
<br />
}<br />
<br />
function showHide(id) <br />
{<br />
var e = document.getElementById(id);<br />
if(e.style.display != 'none') <br />
{<br />
e.style.display = 'none';<br />
} <br />
else <br />
{<br />
e.style.display = '';<br />
}<br />
}<br />
function EC()<br />
{<br />
if(toggle =='on')<br />
{ <br />
obj.src = "images/tbl_collapse.gif";<br />
toggle = 'off' ;<br />
}<br />
else<br />
{<br />
obj.src= "images/tbl_expand.gif";<br />
toogle = 'on';<br />
}<br />
}<br />
<br />
<br />
<br />
And this is the javascript file. What I need right now is when you click on the image. It toggles to the next image. Later on will be a drop down menu, something like show/hide. An example of this is on the website http://blog.movalog.com/a/javascript-toggle-visibility/[^
|
|
|
|
|
one other thing is that is has to be on the same page so its not going from page to page.
|
|
|
|
|
Try this:
function beg()
{
var obj = document.getElementById('test')
if(obj.src == "images/tbl_expand.gif")
{
obj.src = "images/tbl_collapse.gif";
}
else
{
obj.src = "images/tbl_expand.gif";
}
}
Wout Louwers
|
|
|
|
|