Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 31-08-06
crazihos's Avatar
Registered User
 
Join Date: Apr 2005
Location: Central England
Posts: 413
Thanks: 11
Thanked 2 Times in 2 Posts
crazihos is an unknown quantity at this point
  Form help with java script

I'm trying to shorten a loan application form using Java to make it less daunting for people to filll in (hiding things such as partners details until the applicant has already filled in their own details).

I'm using this code for one of the fields and the option homeyes when selected reveals more form for the applicant to fill in which works fine - my problem is that I also need this menu to act as a filter and need the option tenant to jump the applicant to one third party/affiliate website and the option nomortgage to jump to a different third party site.

Can it be done and if so how?

This is the menu i'm using:

<select class=list_menu
id=homeinfo style="WIDTH: 170px"
tabIndex=18
onchange=homeinfo_status(this.options[this.selectedIndex].value)
name=homeinfo>
<option value="" selected>- Select -</option>
<option value=Tenant>Tenant/Live With Parents</option>
<option value=homeyes>Homeowner With Mortgage</option>
<option value=nomortgage>Homeowner With No Mortgage</option>
</select>


and this is the validation script that shows the dropdown:

}

function homeinfo_status(val) {
var home_dropdown = document.getElementById('home_information');
if(val=="homeyes") {
home_dropdown.style.display = "block";
} else {
home_dropdown.style.display = "none";
}
}
onload = function() {
marital_status(document.getElementById('maritalsta tus').options[document.getElementById('maritalstatus').selectedI ndex].value);
previous_address(document.getElementById('timeatad dress').options[document.getElementById('timeataddress').selectedI ndex].value);
homeinfo_status(document.getElementById('homeyes') .options[document.getElementById('homeyes').selectedIndex].value);
if(document.getElementById('second_mortgage_yes'). checked) { second_mortgage("yes"); }
}

Any ideas would really help me out - i'm a java script virgin.

PS... i'll prob be back for more advice in a while...my validations bound to heve bugs in it as well!lol

Cheers

Russ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 31-08-06
Registered User
 
Join Date: Jun 2006
Posts: 177
Thanks: 0
Thanked 1 Time in 1 Post
jonsp is an unknown quantity at this point
Hi,
I'd add an extra little function like this

function handleDropDown(a,b){
if(a==1){window.open('http://TenantSite.com');}
if(a==3){window.open('http://NoMortgageSite.com');}
if(a==2){homeinfo_status(b);}
}
and then wire it up to the dropdown

id=homeinfo style="WIDTH: 170px"
tabIndex=18
onchange="handleDropDown(this.options.selectedInde x, this.options[this.selectedIndex].value);" name=homeinfo>


Jon
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 31-08-06
crazihos's Avatar
Registered User
 
Join Date: Apr 2005
Location: Central England
Posts: 413
Thanks: 11
Thanked 2 Times in 2 Posts
crazihos is an unknown quantity at this point
Cheers for that jonsp

Ive tried trying and messing with that for a couple of hours now and I still cant get it to work even though it looks like it should, is there any other way or a way of just adding some code to this part:

onchange=homeinfo_status(this.options[this.selectedIndex].value)

I normally just use:

onchange="if(this.options[this.selectedIndex].value=='tenant') { document.location.href='http://www.tenantloansuk.com/idevaffiliates/idevaffiliate.php?id=

when theres no hidden fields to be worrying about but this has got me stumped?!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form spam problem mibut Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 16 07-02-07 02:22 AM
Nice PHP Contact Form Script Please accelerator Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 2 27-08-06 09:25 AM
How to insert the 'output' from a javascript script into form field smn2 Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 6 24-08-06 08:46 PM
Ensuring Affiliate Script Tracks John Jupp Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 20-09-05 05:56 PM
Java Script Banner or html banner ? Vrindavan Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 24-02-04 01:22 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7