| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Sep 2005 Location: At Home
Posts: 881
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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?
__________________ |
| |
| | THREAD STARTER #2 (permalink) |
| NamePros Regular Join Date: Sep 2005 Location: At Home
Posts: 881
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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> 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.
__________________ |
| |
| | #3 (permalink) |
| NamePros Member Join Date: Jan 2005
Posts: 97
![]() | 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 |
| |