Jump to content

Java - If field left blank


Recommended Posts

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!

Link to comment
Share on other sites

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;

Link to comment
Share on other sites

  • 2 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...