codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  combined 3 functions that do the same thing  kathym at 21:44 on Thursday, November 27, 2008
 

Hi

I have written 3 functions that perform the same task.
- Form_OLP001 / Form_OLP002 / Form_OLP003

How do I combine them and pass the FormName variable?

My JS Code sample for 1 Form:

function CheckProductForm_OLP001()
{
var iQuantity = document.Form_OLP001.quantity.value;

if (iQuantity >= 5)
{
alert (iQuantity);
window.location.href = "http://www.excelthrulearning.com/etl%5Fhome/toomuch.html";
return;
}
}

How I call it in the html code:

<input type="text " name="quantity" class="TableOutline" size="2" maxlength="3" onBlur="CheckProductForm_OLP001()">

Thank you.





  Re: combined 3 functions that do the same thing  jandus08 at 08:16 on Wednesday, January 21, 2009
 

Hi

you can change the script as
function CheckProductForm_OLP001(obj)
{
var iQuantity = obj.value;

if (iQuantity >= 5)
{
alert (iQuantity);
window.location.href = "http://www.excelthrulearning.com/etl%5Fhome/toomuch.html";
return;
}
}
also you need to change html code as


<input type="text " name="quantity" class="TableOutline" size="2" maxlength="3" onBlur="CheckProductForm_OLP001(this)">









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
• Re: help!
• ADODB.Recordset error (0x800A0CB3)
• Need Your Inputs About Level Editor Interface
• `section` is an unexpected token. Expecting white space. Line 1, position 137.
• Javascript rollover toggle help please!
• help monitoting cpu load on windows machine
• Re: convert aspx page to pdf
• Accessing .htc file
• Access binary data from http


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009