If / Then / Else Help Needed - More Then One Condition Possible?

Sep 19, 2006

I want to write an if / then statement and have tried using this:

var MyVarMailto;
if (Request.Form("LoanRequest") == "Under $250,000") {
if (Request.Form("Organization") == "1") {
MyVarMailto = "emailA@address.com";
}
}
else if (Request.Form("LoanRequest") == "Over $250,000") {
if (Request.Form("Organization") == "1") {
MyVarMailto = "emailB@address.com";
}
}
else {
MyVarMailto = "emailC@address.com";
}

So basically I have a form that gets filled out and submitted which
passes the values to this page. I want to check the values against
conditions that you can probably figure out above and then set the
variable contigent to those values. I tried using AND after the first
condition but that doesn't do anything.

View 14 Replies


ADVERTISEMENT

Href Help Needed

Jul 23, 2005

Can someone help me on this little problem. I am using the following
code in an xsl page.

The directed page is written in the javascript: submitOnClick();

<a href="#">
<xsl:attribute name="onClick">submitOnClick();</xsl:attribute>
Main Menu
</a>

The problem is that when href is given the # sign, the moment i click
on the link it first jumps to the top of the page, before moving to
the directed page.

This can be seen when the page is longer than the screen size.

Is there any other solution to rectify that problem ..........

View 1 Replies View Related

Regex Help Needed

May 18, 2007

I need to strip everything from a file except what is between <body>
and </body>

View 2 Replies View Related

Tab Function Needed

Jul 20, 2005

Has anyone developed a function that can determine the width of a text
string using a proportional font? I would like to do this in order to
insert a variable number of spaces after the text to simulate a tab. Code:

View 5 Replies View Related

Form Action Help Needed...

Jul 20, 2005

I have a form with a name, and action, a post method.

In rare occasion I want the form action to be different to the default
action, so I do this: document.formName.action = "newURL";

This works fine under Mozilla, but does not work under IE5, 5.5 or 6,
it says: Object doesn't support this property or method.

Does anyone know what could be wrong?

View 2 Replies View Related

Allow More Rows To Be Added As Needed

Jul 29, 2009

I have a php form that submits to a database which is all fine, a portion of the form allows for more rows to be added as needed but for some reason it only allows for upto 9 rows to be submitted then it just loops back through the first 9 and i have no idea why.

[Code]....

View 7 Replies View Related

Info Needed On Using JS To Manipulate CSS

Apr 24, 2004

I'm starting to focus my attention on using javascript more (initially in conjunction with css) and would like to know which version of JavaScript introduced functions such as getElementByID() and such. Recommendations for good books/sites would also be appreciated. I also would like to hear where I can find good tutorials and examples of using JS to interact with CSS. One thing I am playing on playing with is using CSS/JS with forms to help users fill in required info. Hoping to make it even more obvious the famous little red asterisks by each form field.

View 6 Replies View Related

IE Blocking Needed Content!

Jan 28, 2005

I am working on a website that utilizes a DHTML (HTML + Javascript) Navigation bar, but IE blocks the "ActiveX" content, despite the fact I am just using javascript. This site will be used by every computer on our network.

Is there any way I can modify the script so that it is not blocked even when this "security feature" enabled?

View 4 Replies View Related

IE To Netscape Event Assistance Needed

Jul 23, 2005

Does the world need another DHTML popup calendar? Probably not, but I'm writing one anyway. It's unique in that it allows drag selection of a range of dates. Works great on IE6 but I'm having some trouble with Netscape and events. In particular, the mousedown event doesn't work. The event fires, but I can't seem to get a handle on what html element was clicked.

View 4 Replies View Related

Basic Help Needed To Hiding And Showing Div

Jul 23, 2005

In a nutshell, I'd like to have a list of items, each of which fills out a
small table which displays some info about a particular item(the items being
a trouble ticket for a tech support ASP-built web-based app). There may be
zero, one, or many of these per ticket. Since some tickets have many of
these items (call them work items), the page can get awful long. I have this
part working already.

So my proposed solution to make the pages shorter would be to have one line
for each of these little work items. If you click the text in that one line,
it shows what had been a hidden div. If you click it again, it hides it.

See below:

View 5 Replies View Related

Help Needed With Event Testing Script

Jul 23, 2005

I'm trying to check for this bug with the following script and it
*seems* to work. In IE it reports "bubbling" and in Firefox "not
bubbling" but I really have no direct way to confirm the Firefox
results until the bubbling bug is fixed.

Basically the test script assigns an onscroll event handler to a
textarea and then scrolls the textarea down then back up, checking to
see if a the event handler works (assigns the "bubbling" variable a
"true").

I had to code things with a few settimeouts otherwise Firefox, unlike
IE, wouldn't display the down then back up scrolling of the textarea.
Which may have been a problem.

Lacking a "debugged" Firefox browser, is there some further (indirect?)
tests and/or rational that would support or discredit this script as a
valid onscroll event check? ....

View 5 Replies View Related

Ascertain Needed Div Height To Fit Content?

Jun 24, 2006

I have a javascript that manipulates the DOM with content that will be
of variable heights. How can I ascertain how high my div needs to be in
order to show all content without scroll bars. Rather than just having
this happen automatically, I want the div to expand with a DHTML
animation. So, I need to know where to tell the script to stop
expanding. In pseudo-code:

function divAni(){
if(this.height > 0){
if(this.height > 0){
this.height = this.height - increment;
}
setTimeout(divAni,delay)
} else {
if(this.height < this.height.needed){
this.height = this.height + increment
}
setTimeout(divAni,delay);
}
}

I'm just not sure how to ascertain how tall the div needs to be for the
content to display.

View 4 Replies View Related

Code Needed For Horizontal Scroller?

May 5, 2011

I need a JavaScript code so that I can achieve the functionality like the attached image. There will be horizontal scroller with left, right arrow for image scrolling. If a user will click on any image then that that image will be opened above the scrolling bar.

View 1 Replies View Related

JQuery :: Version Needed For Paging Tabs?

Dec 15, 2011

I'm working for a company that is using version 1.4.4. But Ive acquired the need to paging tabs.In the example though, It uses 1.3.2. Is this the only version of the library that i can use. or can I use my existing library?

View 1 Replies View Related

Iframe Scrolling - Scroll Bars Automatically Appear When Needed Or Put Them There Permanently

Aug 13, 2009

I know that iframes can be set to have scroll bars automatically apear when needed or put them there permanantly. However, I would like to have a Javascript slider on the topmost page scroll the iframe. It was possible to make a link on the topmost page change the content of the iframe by putting the iframe name in the link's target. Is this possible with a slider? I ask this because some of the content inside the iframe is on external pages so obviously we can't add the scroll bar there.

View 11 Replies View Related

Write A Script That Adds An Extra Field To A Form When Needed

Feb 11, 2010

I have been trying to write a script that allows a user to click on a button like a plus sign to add an additional field for a phone number when they have more than one phone number to enter. I have created a script that sort of does this. It doubles up what is already there, so, the first time, everything is fine, but after that I get a lot more fields than I want. I am a php programmer and not familiar enough with javascript to get to what I want. My script is included below. What I am doing here is retrieving the html content and then adding it to what is already there. In php I would use an if conditional test to see if the data has been retrieved.

The first time it would retrieve the data into a variable. After that it would not retrieve it. I think I am getting into some scope and sequence issues here. Javascript is a bit different than php in these regards. Also there is a commented line in the code that asks another question about the use of variables that I don't understand. I also tried using appendChild() here to no avail. I couldn't get that to work at all.

[Code]...

View 3 Replies View Related

Form Validation Code Needed To Make Sure Radio Button Is Selected

Apr 7, 2010

Does anybody know how i check to see if the radio button is select and also can anybody tell me how i can check for an email in the correct format the function isValidEmail in the above alows emails to pass through.

View 4 Replies View Related

JQuery :: Beta Testers Needed For Form Plugin File Upload Support

Mar 22, 2007

I've added file upload support to the form plugin and I could use some help testing it out.If this feature interests you then go ahead and grab the beta plugin at:URL...File upload support is baked right into the plugin and there are no external dependencies.The plugin will automatically detect file input elements and use an iframe to submit the form if there are files to be uploaded.No extra coding or metadata is needed to take advantage of this new feature.In addition, even though an iframe is used instead of the XHR object, callbacks and global triggers still work as expected (so any code that you have in place to display activity indicators or blocking elements will still work).However, there are some challenges when using iframes in this manner.For one, it is quite difficult to determine if the submit operation succeeded or failed.The iframe becomes the target of the submit operation and so that is where the server response is written.The form plugin does its best to determine the data type (html, xml, etc),but the status is always 'success' unless an exception is caught during the type determination.URL...

If you use this page for testing *please* be kind to my server and only upload small files! I'd really prefer that you download the plugin and integrate it into your own test environment if possible.I've done some testing on FF, IE and Opera and the results are encouraging. I don't have access to Safari so I'm sure there are issues lurking for that platform.If you're interested in the code you can find it all tucked into the end of the ajaxSubmit method in a function called "fileUpload".

View 24 Replies View Related

Condition Insertion

Jul 23, 2005

Is it possible to make a file insertion conditional? I now have the code:

'<script type="text/javascript" src="http://www.site.com/showit.js">'

And I wondered if it is possible to make this conditional, something like:
if (mycondition==true) include('http://www.site.com/showit.js');

View 4 Replies View Related

Get A Value If A Condition Is Filled

Jul 23, 2005

if (form.interface_template.options.length > 0) {
template =
form.interface_template.options[form.interface_template.selectedIndex].value

} else {
template = ''
}

View 4 Replies View Related

Put If Condition In Function ?

Apr 26, 2011

I have an table in which an select box like this:

Following have an option in OS: windows/Linux. i only want when user select OS - linux ... then function call otherwise if user select OS - window ... no need to call this function validate() i think it requires if condition in function Validate().... how it is posible to put if condition in function validate()

View 1 Replies View Related

How To Add 1 Condition To Script.?

Nov 30, 2006

Currently have a txt input with default value="Your Name". with the on focus event to clear default text.

However if a user doesn't touch the txt box the the script goes on to validate the email box below because we have "Your Name" loaded up. and that passes validation below.

How do I go about adding another condition to look for string "Your Name" to the following if statement.

I tried adding another "||" statement after value.length <2 part and got nowhere.

function checkmailform(){
if ( (document.forms.newsletterform.Name.value == null) || (document.forms.newsletterform.Name.value.length < 2) ) {alert("Input First NewsName");
document.forms.newsletterform.Name.focus();
return false;
}else{...

View 4 Replies View Related

Elseif Condition?

Apr 27, 2002

Is there a way in javascript to use multiple if conditions? For example I need something like this: Code:

if( email=="" )
{
do something
}
elseif( !issemail(email) )
{
do something else
}

I know it would be possible to use else and then another if but since this javascript code is PHP-generated and I'd have about 5 conditions, I can't really do this easily.

View 10 Replies View Related

XMLHttpRequest() Completion Condition?

Dec 12, 2005

I came across something I'm unfamiliar with -- there's an added check for window.location.href.indexOf("http")==-1 to see if the XMLHttpRequest send() completed, i.e.,

if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))

Does anyone know why this is done or which browser this (kludge?) is meant for?

View 3 Replies View Related

Reating Checkboxes With Condition.

Nov 7, 2006

I created two forms. In the first frame i had Items with checkbox like
names of students etc. When ever i checked on any name It's display on
the other frame. Up to know it's fine. But when i deselcted any check
box it again display same name.

My requirement is when i deselected the checkbox that particular
student name is deleted from the list .

View 6 Replies View Related

JQuery :: Use OR Condition For Validation?

Jan 5, 2012

I am using jquery.validate.js for validating the forms.

The issue now is I have a dropdown list with values. Say a dropdown has the values 'One', 'two', 'Three', 'Four','Five'.

If the value is 'Three' OR 'Four' . The next 2 input fields are required. Else those are not required. The value will be seperated with optgroups.

I tried with different options but I couldnt find the solution. How to validate this?[code]...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved