alpha Posted May 4, 2009 Report Share Posted May 4, 2009 I would like to input a default--"NONE"--into a text field if a user submits a web form with nothing in that field. I assume I need to do this with java script in the footer of the form, but I'm not sure how. Also, is it possible to do the same thing with a file field? When people view this record, I would like it to say "No File Uploaded" if one was not. Is it easier to do this when the form is submitted or when the field is displayed? Thanks! Quote Link to comment Share on other sites More sharing options...
alpha Posted May 5, 2009 Author Report Share Posted May 5, 2009 Does anyone have any idea why this won't work? Please help... been spending almost all day on this. I want the field Job_Comment (which is a long text field) to equal "None" if the user leaves it blank. I have deployed this in the footer of a web form data page. function job_blank() { var jobc = document.getElementById("InsertRecordJob_Comment").value; if (jobc.equals("")) { document.getElementById("InsertRecordJob_Comment").value="None"; } } document.getElementById("caspioform").onsubmit=job_blank; Quote Link to comment Share on other sites More sharing options...
alpha Posted May 7, 2009 Author Report Share Posted May 7, 2009 I figured this out on my own, except I can't figure out how to do the same thing with fields of the "file" type. Please help. Quote Link to comment Share on other sites More sharing options...
bahar_vm Posted May 18, 2009 Report Share Posted May 18, 2009 For the file data type field, I think you better use the script when displaying the field. So you will check if the value is blank and if it is then hide the field or display none. Best, Bahar M. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.