Jump to content

Form Problem.


thebeam
 Share

Recommended Posts

I've changed an information on the form. <td colspan="2">How did you learn about CosmeticVacations? </td> </tr> <tr> <td><input name="CVreference" type="radio" value="Web Search">Web Search</td> <td><input name="CVreference" type="radio" value="E!-Channel">E!-Channel (TV-Show) </td> </tr> <tr> <td><input name="CVreference" type="radio" value="Press Release"> Press Release </td> <td><input name="CVreference" type="radio" value="Referral"> Referral </td> </tr> <tr> <td valign="top"><input name="CVreference" type="radio" id="Other"> NBC Today Show </td> <td valign="top"> </td> </tr> <tr> <td valign="top"><input name="CVreference" type="radio" id="Other"> Other: </td> <td valign="top"> <input name="CVreference" type="text" id="Other"></td>So... this is the part that i've add three new links. The NBC Todays Show Radio Button, The OTher Radio and the Other text box.But how can i made it work? it doenst send to the email. if i check this 3 new option, it goes like ON. the source is like id=OTHER because the other id already exists... $FTGCVreference = $_POST['CVreference'];this is where i have to add the new IDS... but where i can find this?? im not the creator of this website, and im learning about. so if u could help. thanks.

Link to comment
Share on other sites

You need to add a "value" to each of the radio buttons. This entire list needs to be reformatted. All the radio buttons need the same "name" attribute, but each one needs a different "value" attribute. Like this:

<input type="radio" name="CVreference" value="something">Something<br><input type="radio" name="CVreference" value="another">Another<br><input type="radio" name="CVreference" value="other">Other<br>

Notice that they all have the same "name", and that the "value" is different for each. Then in the PHP page, when you get the value of the radio button from $_POST, it will equal the value of whatever they chose.The way you have it set up now, none of the radio buttons have a name at all, and some have a value and some have an id.Edit: I'm retarded, they do all have a name. But they each need a value, delete the ids.

Link to comment
Share on other sites

I got it. thanks a lot.about the text box.if ppl use the Other radio, so they have to tell what other was...there is someway to make the cursor go directly to the box, when the other is cheked? and the text box already have to be value? or the id ?

Link to comment
Share on other sites

You can do that with a little javascript.

<input type="radio" name="CVreference" value="other" onclick="jump_to_element('reason')">Other<br><textarea id="reason" rows="3" cols="40"></textarea><script type="text/javascript">function jump_to_element(elId){  document.getElementById(elId).focus();}</script>

Notice here that the textarea has an id ("reason"), which is used by the javascript function getElementById. That function gets the name "reason" from the "onclick" in the radio button. Let me know if that's confusing.

Link to comment
Share on other sites

<td colspan="2">How did you learn about CosmeticVacations? </td> </tr> <tr> <td><input name="CVreference" type="radio" value="Web Search">Web Search</td> <td><input name="CVreference" type="radio" value="E!-Channel">E!-Channel (TV-Show) </td> </tr> <tr> <td><input name="CVreference" type="radio" value="Press Release"> Press Release </td> <td><input name="CVreference" type="radio" value="NBC Today Show"> NBC Today Show </td> </tr> <tr> </tr> <tr> <td height="55"><input name="CVreference" type="radio" value="Referral" onclick="jump_to_element('reason')"> Referral <br> <input type="radio" name="CVreference" value="Other" onclick="jump_to_element('reason')">Other<script type="text/javascript">function jump_to_element(elId){ document.getElementById(elId).focus();}</script> </td> <td> <textarea name="textarea" cols="40" rows="1" id="reason"></textarea> If you selected referral or other, please tell us </td> </tr>this is the source now.i moved and get the refferal and other working in the same text box.thanks man.i have one more newbie question. i uploaded the files. but doenst changed yet. could be because the mass traffic that we having on the website? a lot of visits ?

Link to comment
Share on other sites

If you uploaded it, it should have changed. Try uploading again, and look at the size of the source and destination to make sure they are identical, maybe it went to the wrong place last time.Also try emptying your browser cache, IE is notorious for insisting on using the cache and refusing to get an updated page. I don't have much experience with Firefox, but Opera seems good about getting a new copy if I'm insistent enough.Also, I didn't know you wanted a 1-line text field. You can replace the text area with this if you only need 1 line:

<input type="text" name="textarea" size="40" id="reason">

Link to comment
Share on other sites

well. acctually, i donwload form the server, its uploaded. but on the website doenst... and thanks for the code.im using dreamweaver. any information about it. and everything is correct... i will try to upload again. and again.

Link to comment
Share on other sites

About the upload thing.If i let the website connect when i do the changes, whne i uploaded, it doesnt change. i have to disconnect, and then connect again. its all right now.thanks man. thanks a lot.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...