The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML form
hisyedadil
post May 30 2012, 03:28 PM
Post #1





Group: Members
Posts: 1
Joined: 30-May 12
Member No.: 17,197



i got a html ready made code for the form. When i click send, i get a mail but no content of what is filled in the form, the form which i receive is empty. that means the php code is correct as i get the mail to my id, have used sendform.php code before and it works fine. the html code needs some changes.
here is the code

<form action="sendform.php" method="post" id="form" >
<fieldset>
<label><input type="text" value="Name" onBlur="if(this.value=='') this.value='Name'" onFocus="if(this.value =='Name' ) this.value=''"></label>
<label><input type="text" value="Email" onBlur="if(this.value=='') this.value='Email'" onFocus="if(this.value =='Email' ) this.value=''"></label>
<label><input type="text" value="Mobile no" onBlur="if(this.value=='') this.value='Mobile no'" onFocus="if(this.value =='Mobile no' ) this.value=''"></label>
<label><textarea onBlur="if(this.value==''){this.value='Message'}" onFocus="if(this.value=='Message'){this.value=''}">Message</textarea></label>
<div class="btns"><a href="#" class="button">Clear</a><a href="sendform.php" class="button" onClick="document.getElementById('form').submit()">Send</a></div>
</fieldset>
</form>


I even know i have to make some changes here, but dont know where exactly do i make changes so that i get the completely filled form to my e-mail address.

<div class="btns"><a href="#" class="button">Clear</a><a href="sendform.php" class="button" onClick="document.getElementById('form').submit()">Send</a></div>
</fieldset>
</form>


Please note: i get the form twice to my e-mail. dont know why. i am an amateur.
Please help, your help will be really appreciated. for any more info mail me at hisyedadil@yahoo.co.in

This post has been edited by hisyedadil: May 30 2012, 03:28 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
1q2w3e4r
post May 31 2012, 12:10 AM
Post #2





Group: Members
Posts: 5
Joined: 30-May 12
Member No.: 17,200



You can use <placeholder="text"> to replace ><textarea onBlur="if(this.value==''){this.value='Message'}" onFocus="if(this.value=='Message'){this.value=''}">


also, posting a pastebin link to your python script could prove to be helpful, possibly.

This post has been edited by 1q2w3e4r: May 31 2012, 12:11 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post May 31 2012, 01:39 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 4,852
Joined: 23-August 06
From: Europe
Member No.: 9



Why do you use an A element to submit the form? Why not use a normal submit button, using INPUT type="submit"?

The HREF of A probably causes the form to submit twice, as it's already triggered by the form's ACTION.

@1q2w3e4r
Placeholder is an attribute, not an HTML element, and not all browsers support it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 1st August 2015 - 02:46 AM