NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Some Javascript help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-31-2006, 12:46 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
asgsoft's Avatar
Join Date: Sep 2005
Location: At Home
Posts: 881
asgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of light
 



Some Javascript help


I need to have a dynamic javascript that can work on nearly all platforms.

Basicly you have a check box that says tell a friend. When you check it it shows a drop menu asking the number of friends (Max of 6)

It should display textboxes repeated by the number chosen to enter email address.

I will be putting an email validating script on all textboxes.


How can I acheive that?
asgsoft is offline  
Old 04-05-2006, 12:09 PM THREAD STARTER               #2 (permalink)
NamePros Regular
 
asgsoft's Avatar
Join Date: Sep 2005
Location: At Home
Posts: 881
asgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of light
 



OK, I have this so far:
Code:
<script type='text/javascript'>
function showField(div_name)
{
 var txt = "";
 var num = document.form1.item_count.value;
 for(i = 0; i < num; i++)
 {
   txt += "<input type='text' name='friendname_" + i + "' value='name' onfocus='this.value='''/></input><input type='text' name='friendemail_" + i + "' value='email'/><br /></input>";
 }
 document.getElementById(div_name).innerHTML = txt;
}

function showDropDown()
{
 if(document.form1.checkbox_name.checked == true)
 {
   document.getElementById('dropdown').style.display = "block";
 }
 else
 {
  document.getElementById('dropdown').style.display = "none";
  document.getElementById('email_div').innerHTML = null;
 }
}
</script>
How can I make the textboxes empty when you click on them?

s there a way of resetting the value of the drop down menue when it is hidden?

Also why doesn't it show the textbox tag in the html of the file when it is showing them?
????: NamePros.com http://www.namepros.com/programming/182461-some-javascript-help.html

Have a look at this site to see it in action: http://asgsoft.net/petition/tellafriend.php?id=1

PLEASE TICK THE BOX TO START.
asgsoft is offline  
Old 04-05-2006, 01:56 PM   #3 (permalink)
NamePros Member
 
crazyluv's Avatar
Join Date: Jan 2005
Posts: 97
crazyluv is an unknown quantity at this point
 



Ok use this to erase text when text box is clicked: onFocus="javascript:this.value='';"

As for the rest I really don't know sorry.
__________________
AEInbetween
crazyluv is offline  
Old 04-05-2006, 02:04 PM THREAD STARTER               #4 (permalink)
NamePros Regular
 
asgsoft's Avatar
Join Date: Sep 2005
Location: At Home
Posts: 881
asgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of light
 



doesn't work
asgsoft is offline  
Old 04-05-2006, 02:20 PM   #5 (permalink)
NamePros Regular
 
Noobie's Avatar
Join Date: Feb 2006
Location: Montreal, Quebec, Canada
Posts: 324
Noobie is on a distinguished road
 



try onClick="formname.textboxname.value='';"
__________________
Goldkey.com is a scam
What's your BMI? | Timestamp Generator
Noobie is offline  
Old 04-05-2006, 03:37 PM THREAD STARTER               #6 (permalink)
NamePros Regular
 
asgsoft's Avatar
Join Date: Sep 2005
Location: At Home
Posts: 881
asgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of lightasgsoft is a glorious beacon of light
 



please bare in mind its part of the variable txt
asgsoft is offline  
Closed Thread


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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:35 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger