| | |
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
Views: 614 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class clean cms code countingeverycharactersfromastring cron curl database date directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail match menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions simple sms soap source space spam speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





