Setting null form fields

Results 1 to 3 of 3

Thread: Setting null form fields

  1. #1
    Join Date
    Dec 1969

    Default Setting null form fields

    I am using an asp form for users to register for my site. I have included in the registration form a srolling text box with the sites terms and conditions set as the initial value. The problem is when the form is submitted it is trying to enter this value into the querystring, and (either because it is too long or contains illegal characters, I don't know) is preventing the form query being executed. Can anyone suggest a simple means by which I can either exclude this form field from the querystring or reset it to a "blank" upon execution of the form? Or do I need to change the layout of my page so the textbox is outside the form?

  2. #2
    Join Date
    Dec 1969

    Default RE: Setting null form fields

    In the form tag do the following:<BR><BR>&#060;form name="yourformname" onSubmit="this.termsfield.value=&#039;&#039;"&#062 ;<BR><BR>Or you can use the onClick event of your submit button like:<BR><BR>&#060;input type="submit" onClick="this.form.elements[&#039;termsfield&#039;].value=&#039;&#039;"&#062;<BR><BR>termsfield would be the name for your scrolling text box.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default If I understand you correctly,

    you have a form field value which upon submittal you add on to the end of the querystring for your action tag? I assume you are executing a javascript function from the onSubmit event.<BR><BR>If yes, make sure you are encoding the value to account for those "illegal" characters (i.e. - spaces, etc).<BR><BR>Hint...escape function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts