Click to See Complete Forum and Search --> : HELP!!! With Form
stormrevolution
05-16-2003, 01:26 PM
Help urgently needed!!!
I have a form on my website which i got from "bravenet", it will only currently send to a certain address, that is the one that the account with "bravenet" is made with. But i want vistors to my site to beable to send a copy of the form to a different address which can be selected from a dropdown menu. Any help on this would be welcomed. Thank you all.
Steve Locksley
VEIW THE FORM HERE:
http://mysite.freeserve.com/stormrevolution/revolution_home.htm
the form is on the right hand side of the screen under the title "request centre"
This is done server-side not with Javascript. You cannot edit pre-made PHP scripts (PHP is the server-side language they use) from Bravenet.
stormrevolution
05-16-2003, 01:35 PM
well, the is another form i can use.
but the only problem is that the e-mail MUST be typed into the text box. it will not work with a dropdown.
But i found a script on this site where you select a item from a drop down menu, then a second dropdown with subselections is displayed, then you selection from that dropdown is displayed in a text box. is there anyway to edit the script so it will work by just using 1 dropdown instead of the 2???
stormrevolution
05-16-2003, 01:40 PM
heres the script...
<!-- TWO STEPS TO INSTALL CATEGORY SELECTION:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<style>
#sub1, #sub2, #sub3
{ position: absolute;
left: 480px;
visibility: hidden;
z-index: 3
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Michele Bracci (michele@againstwhat.it) -->
<!-- Web Site: http://www.againstwhat.it -->
<!-- Begin
catnumber = 3
offset = 150
performOnchange = false
if (document.all) {
docObj = "document.all."
styleObj = ".style"
} else {
docObj = "document."
styleObj = ""
}
function openselect(subcat) {
popupselect = eval(docObj + subcat + styleObj)
popupselect.visibility = "visible"
}
function closeselect(submenu,subcat){
popupselect = eval(docObj + subcat + styleObj)
if (submenu.selectedIndex != 0) {
popupselect.visibility = "hidden"
numchoice = submenu.selectedIndex
choice = submenu[numchoice].value
subcategory.value = choice
submenu.selectedIndex = 0
}
}
function lock() {
performOnchange = false
}
function unlock() {
performOnchange = true
}
function selectSub(cat) {
for (i=1; i <= catnumber; i++) {
subcat = "sub" + i
popupselect = eval(docObj + subcat + styleObj)
popupselect.visibility = "hidden"
}
if (performOnchange == true) {
letsopen = "sub" + cat.selectedIndex
if (letsopen == "sub0") {
alert("No category selected")
choice = "- subcategory -"
subcategory.value = choice
cat.focus()
} else {
openselect(letsopen)
lock()
}
}
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<div align="center">
<span id="sub1">
<select name="subannounce" onchange="closeselect(this,'sub1')">
<option selected value="">- subcategory -
<option value="cars">cars
<option value="houses">houses
<option value="guitars">guitars
</select>
</span>
<span id="sub2">
<select name="subarts" onchange="closeselect(this,'sub2')">
<option selected value="">- subcategory -
<option value="music">music
<option value="lyrics">lyrics
<option value="painting">painting
</select>
</span>
<span id="sub3">
<select name="subsoftware" onchange="closeselect(this,'sub3')">
<option selected value="">- subcategory -
<option value="php">php
<option value="java">java
<option value="asp">asp
<option value="mysql">mysql
</select>
</span>
<select name="categoria" onmouseover="unlock()" onchange="selectSub(this)">
<option selected value="">-- choose category --
<option value="announce">Announce
<option value="arts">Arts
<option value="software">Software
</select><br>
<input type="text" name="subcategory" readonly="readonly" value="- subcategory -">
</div>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
<!-- Script Size: 3.41 KB -->
if anyone can work out how to edit this and place it into a form please contact me all help is welcomed! ;) cheers.
Look, the only way to edit the script is if your server supports PHP and you have the source code.
stormrevolution
05-16-2003, 01:49 PM
lol, sorry.
OK heres the basic info.
theres a tell-a-friend script that will send the submited form the the e-mail address the user enters. But i want the user only to beable to send the form to certain e-mails. I tryed useing a dropdown menu but didnt work as the script will only work if the user enters the e-mail address into a textbox.
I found the above script, when u select a item from the dropdown menu it will place the info into a text box. only problem is it has 2 dropdown menus. When the script loads you select a item from the 1st and then the 2nd dropdown opens then you select from there and it pastes the info into a non-edit text box. But im wondering if there is a way and how i can edit this script so it will only use 1 drop down menu.
---------Next item! lol------------
With the e-mail form that sends to a address my account is in "as posted 1st" there is a way to send carbon copys by entering some code into the form script. But is there anyway at all to make the carboncopy script work with a dropdown menu.
Cheers for all your help.
stormrevolution
05-16-2003, 01:55 PM
this is the carbon copy code i found which works with bravenet forms, anyway to put it into a text box mode which the user selects???
<input type="hidden" name="carboncopy" value="someone@somewhere.com">
I think I understand. Try this:
<input type=text name="email" value="Enter your email address" onChange="var emailList = new Array('me@myhouse.com', 'you@yourhouse.com', 'us@ourhouse.com'); for(i=0;i<emailList.length;i++){ if(this.value!=emailList[i]){alert('You must enter one of the following as the email address: '+emailList[0]+'\n'+emailList[1]+'\n'+emailList[2]); this.value=''; return false;} }">
stormrevolution
05-16-2003, 02:12 PM
im having a script error! :(
heres the script im trying to use with the addition of your script.
<div align="center">
<form action="http://pub11.bravenet.com/announce/send.php" method="post">
<input type="hidden" name="usernum" value="897087641" />
<input type="hidden" name="cpv" value="1" />
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#999999"><tr><td>
<table cellpadding="2" cellspacing="1" border="0" bgcolor="#999999">
<tr><th bgcolor="#eeeeee">
<font face="Verdana,Arial" size="1">Tell A Friend!</font>
</th></tr><tr bgcolor="cornsilk"><td align="center">
<font face="Verdana,Arial" size="1"><b>Type In Your Name:</b><br />
<input type="text" name="name" size="15" maxlength="100"><br />
<b>Type In Your E-mail:</b><br />
<input type="text" name="youremail" size="15" maxlength="100" /><br />
<b>Your Friend's E-mail:</B><br />
<input type=text name="emailaddress" value="Enter your email address" onChange="var
emailList = new Array('me@myhouse.com', 'you@yourhouse.com', 'us@ourhouse.com');
for(i=0;i<emailList.length;i++){ if(this.value!=emailList[i]){alert('You must
enter one of the following as the email address:
'+emailList[0]+'\n'+emailList[1]+'\n'+emailList[2]
); this.value=''; return false;} }" size="20"><br />
<b>Your Comments:</B><br />
<textarea name="yourmessage" cols="14" rows="2" wrap="soft"></textarea><p>
<b>Receive copy:<input type="checkbox" name="metoo" value="yes" /> </b><input type="submit" name="submit" value=" GO " /></font></td></tr></table>
</td></tr></table><br /><a href="http://www.bravenet.com/">
<img src="announbutt.gif" border="0" width="100" height="35" /></a>
</form>
It should all be on one line.
stormrevolution
05-16-2003, 02:45 PM
something like that, but i would like a dropdown menu that when you select a item from it the value of the item is pasted into a textbox automaticly. something like this
<option value="email@somewhere.com">Steve</option>
<option value="email2@somewhere.com">Jon</option>
<option value="email3@somewhere.com">bob</option>
when a name (ie: steve) is selected the email will be pasted into a a text box.
Something like this:
http://jona.t35.com/experiments/slct_add_textarea.html
stormrevolution
05-16-2003, 03:09 PM
would look, but "the page cannot be displayed"
Oh well, server is down. OK, here is the source code anyway:
<html><head><title>Testing....</title>
<!-- NOTE: This file created by Jona. Do not use this file or any source code in it without permission from Jona. -->
<script>
function addIt(){document.frm.area.value=document.frm.slct[document.frm.slct.options.selectedIndex].value}
</script></head><body><form name="frm">
<select name="slct" size="1" onchange="addIt()">
<option selected value="Jon Doe">Jon Doe
<option value="Jane Doe">Jane Doe
<option value="Avery Smith">Avery Smith
</select><br>
<textarea name="area" readonly></textarea>
</form></body></html>
stormrevolution
05-16-2003, 03:29 PM
thats the thing i was looking for!!!!!!!!
how do i change the textarea into a 1line text box as that is what i need.
Change the <textarea> to <input type="text" name="area"> and change the select boxes:
<select name="slct" onChange="addIt(this.form)">
<option value="me@myplace.com">me</option>
<option value="you@yourplace.com">you</option>
<option value="us@ourplace.com">us</option>
</select>
And change the code to this:
function addIt(f){f.area.value=f.slct[f.slct.options.selectedIndex].value;}
stormrevolution
05-16-2003, 04:07 PM
ok changed it all but the script no longer works.
here is the full script with the changes.
<html><head><title>Testing....</title>
<!-- NOTE: This file created by Jona. Do not use this file or any source code in it without
permission from Jona. -->
<script>
function addIt(f){f.area.value=f.slct[f.slct.options.selectedIndex].value;}
</script></head><body><form name="frm">
<select name="slct" onChange="addIt(this.form)">
<option value="me@myplace.com">me</option>
<option value="you@yourplace.com">you</option>
<option value="us@ourplace.com">us</option>
</select>
<input type="text" name="area" size="20">
</form></body></html>
stormrevolution
05-16-2003, 04:13 PM
sorry its working now.
thanks for all your help!! ;)
stormrevolution
05-16-2003, 04:18 PM
sorry one last question...
how do i insert the code you gave me into this:
>>>>>>>>>>>>>>BRAVENET FORM CODE<<<<<<<<<<<
<form action="http://pub11.bravenet.com/announce/send.php" method="post">
<input type="hidden" name="usernum" value="897087641" />
<input type="hidden" name="cpv" value="1" />
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#999999"><tr><td>
<table cellpadding="2" cellspacing="1" border="0" bgcolor="#999999">
<tr><th bgcolor="#eeeeee">
<font face="Verdana,Arial" size="1">Tell A Friend!</font>
</th></tr><tr bgcolor="cornsilk"><td align="center">
<font face="Verdana,Arial" size="1"><b>Type In Your Name:</b><br />
<input type="text" name="name" size="15" maxlength="100"><br />
<b>Type In Your E-mail:</b><br />
<input type="text" name="youremail" size="15" maxlength="100" /><br />
<b>Your Friend's E-mail:</B><br />
<select size="1" name="emailaddress">
<option value="manager@storm-live.co.uk">ONE</option>
<option value="ejsaucey@storm-live.co.uk">two</option>
</select><br />
<b>Your Comments:</B><br />
<textarea name="yourmessage" cols="14" rows="2" wrap="soft"></textarea><p>
<b>Receive copy:<input type="checkbox" name="metoo" value="yes" /> </b><input type="submit" name="submit" value=" GO " /></font></td></tr></table>
</td></tr></table><br /><a href="http://www.bravenet.com/">
<img src="announbutt.gif" border="0" width="100" height="35" /></a>
</form>
>>>>>>>>>>YOUR CODE<<<<<<<<<<<<<<
<html><head><title>Testing....</title>
<!-- NOTE: This file created by Jona. Do not use this file or any source code in it without
permission from Jona. -->
<script>
function addIt(f){f.area.value=f.slct[f.slct.options.selectedIndex].value;}
</script></head><body><form name="frm">
<select name="slct" onChange="addIt(this.form)">
<option value="">Select One...</option>
<option value="todaystudio@storm-live.co.uk">(Storm) Today</option>
<option value="extrastudio@storm-live.co.uk">(Storm) Extra</option>
<option value="kbj15@hotmail.com">(Storm) Jukebox</option>
<option value="classicstudio@storm-live.co.uk">(Storm) Classic</option>
<option value="clublandstudio@storm-live.co.uk">(Storm) Clubland</option>
</select>
<input type="text" name="area" size="20" readonly>
</form></body></html>
;) cheers! :)
Added code in blue.
<script type="text/javascript">
<!--
function addIt(f){if(f.email.options[f.email.options.selectedIndex].value!=-1){f.emailaddress.value=f.email.options[f.email.options.selectedIndex].value;}else{alert('You must choose one.'); return false;} }
// -->
</script>
<form action="http://pub11.bravenet.com/announce/send.php" method="post">
<input type="hidden" name="usernum" value="897087641" />
<input type="hidden" name="cpv" value="1" />
<table cellpadding="0" cellspacing="0" border="0" bgcolor="#999999"><tr><td>
<table cellpadding="2" cellspacing="1" border="0" bgcolor="#999999">
<tr><th bgcolor="#eeeeee">
<font face="Verdana,Arial" size="1">Tell A Friend!</font>
</th></tr><tr bgcolor="cornsilk"><td align="center">
<font face="Verdana,Arial" size="1"><b>Type In Your Name:</b><br />
<input type="text" name="name" size="15" maxlength="100"><br />
<b>Type In Your E-mail:</b><br />
<input type="text" name="youremail" size="15" maxlength="100" /><br />
<b>Your Friend's E-mail:</B><br />
<select name="email" size="1" onChange="addIt(this.form);">
<option value="-1">Select One...</option>
<option value="todaystudio@storm-live.co.uk">(Storm) Today</option>
<option value="extrastudio@storm-live.co.uk">(Storm) Extra</option>
<option value="kbj15@hotmail.com">(Storm) Jukebox</option>
<option value="classicstudio@storm-live.co.uk">(Storm) Classic</option>
<option value="clublandstudio@storm-live.co.uk">(Storm) Clubland</option>
</select><br />
<input type="text" name="emailaddress" readonly>
<b>Your Comments:</B><br />
<textarea name="yourmessage" cols="14" rows="2" wrap="soft"></textarea><p>
<b>Receive copy:<input type="checkbox" name="metoo" value="yes" /> </b><input type="submit" name="submit" value=" GO " /></font></td></tr></table>
</td></tr></table><br /><a href="http://www.bravenet.com/">
<img src="announbutt.gif" border="0" width="100" height="35" /></a>
</form>