If Statement

Results 1 to 2 of 2

Thread: If Statement

  1. #1
    Navtej Singh Guest

    Default If Statement

    I am using an If statement for modifying a record. The current record is shown on the screen, and i the user would like to update it, then they input the new data in the text box.<BR><BR>If the textbox is greater than "", then the record is update, else it is left alone.<BR><BR>What should my If statement Look like?

  2. #2
    peterjl@austec.net.au Guest

    Default RE: If Statement

    I am having difficulty uderstanding what you could have a problem with!<BR><BR>There may be a slight problem with your suggested method of updating. Say the person updating actually intends to delete the contents of the field when they see it in the form, they submit a blank input field your database will not be updated with a blank. This would be okay if you did intend to prevent the field from being blank.<BR><BR>Anyway if your form page has a textbox like this:<BR>&#060;form action=xxx.asp method=post&#062;<BR>Input value: &#060;input type=text name=f1 value="something"&#062;<BR>&#060;input type=submit&#062;<BR>&#060;/form&#062;<BR>then you input it to the asp page which looks like this:<BR><BR>&#060;%<BR> If Request.form("f1") &#060;&#062; "" then<BR> &#039; Update the database field<BR> End If<BR>%&#062;<BR><BR>

Posting Permissions

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