| | |
Initial Values
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi all, I put some initial values in a form field to help the user, i use php to extract the form data and send it via email. How do i get the initial value in the text field to stop appearing in the email. example, I have a name tag Town and the initial value I have shown that I want in that form field is Town. You can delete the initial value and then type the Town name, but i don't want users to have to do this.
I get Town name tag supplied but I also get
"Town: TownInverness" supplied by email, how do i stop the initial value been collected?
does this make sense?
thanks
I get Town name tag supplied but I also get
"Town: TownInverness" supplied by email, how do i stop the initial value been collected?
does this make sense?
thanks
Okay, maybe I'm going about this wrong, If I just have the user filling in the form by telling them to delete the initial value before they type would this be a better way of doing this? That way I collect only the new value or text they put in the box with my php script. If they have javascript turned off, this I understand will also affect the browser by not deleting the value when they click in the box.
Is this the better thing to do?
Is this the better thing to do?
Hi..
According to what you have written in your post, i'll suggest you to use Javascript for this purpose..
When someone clicks on the text box, the initial value in it gets empty (town in this case), and then the new value entered by the user will appear in the email.. See the code attached
Hope this helps..
According to what you have written in your post, i'll suggest you to use Javascript for this purpose..
When someone clicks on the text box, the initial value in it gets empty (town in this case), and then the new value entered by the user will appear in the email.. See the code attached
Hope this helps..
PHP Syntax (Toggle Plain Text)
<script language="javascript" type="text/javascript"> function when_obj_blur(frmObject,frmValue) { if(frmObject.value=="") frmObject.value=frmValue; } </script> <input type="text" name="Town" value="Town" onfocus="javascript:this.value='';" onblur="javascript:when_obj_blur(this,'Town')">
![]() |
Similar Threads
- integer values into array (Community Introductions)
- Need help with first c++ program (C++)
- readin flip-flop charecteristic table (C)
- Need to know hwo to go about this (classes/accessor functions) (C++)
- Graphics In Pixel: Part II (C++)
- summations and combinations (C++)
- Objects (C)
Other Threads in the PHP Forum
- Previous Thread: PHP and MYSQL Connections
- Next Thread: PHP+Ajax Help
| Thread Tools | Search this Thread |
advanced apache api array beginner binary broken cakephp checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms soap sorting source space sql startup stored syntax system table traffic tutorial update upload url validator variable video web xml youtube zend





