Clear fields after submit

I have a panel that has various input fields. When the user submits the information, it is saved in an SQLite database. I’d like to clear the fields once the info is submitted, but simply setting the string to “” doesn’t work.

FieldText.text=“”;
What’s the best way to clear them out? Thanks!

Perhaps my question is too vague: Here is the function

public void GetOilChangeData()
	{
		OilServiceDateField=OilServiceText.text;
		OilLocationField=OilLocationText.text;
		OilMileageField=OilMileageText.text;
		OilLaborField=OilLaborText.text;
		OilBrandField =OilBrandText.text;
		OilPriceField= OilPriceText.text;
		FilterBrandField= FilterBrandText.text;
		FilterPriceField=FilterPriceText.text;
		OilFilterPurchaseLocationField =OilFilterPurchaseLocationText.text;

		DatabaseManager.Instance.SQLiteInit();
		DatabaseManager.Instance.SaveOilChangeInfo(OilServiceDateField, OilLocationField, OilMileageField, OilLaborField, OilBrandField, OilPriceField, 
		                                           								  FilterBrandField, FilterPriceField, OilFilterPurchaseLocationField);

	}

when are you calling FieldText.text=“”;?
Because there is no function to clear text field.

public InputField inputfieldname;
inputfieldname.Select();
inputfieldname.text = "";

Try this, i’m using it :slight_smile:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class InputHelper : MonoBehaviour {
	
	public InputField clearIt;

	public void submittingClear()
	{
		clearIt.text = "";
	}
}

Remember to add the asset to the script :)!

[84619-skærmbillede-2016-12-23-kl-150610.png|84619]

And done! It should work!
[84620-skærmbillede-2016-12-23-kl-150850.png|84620]

jmgek, you had it right!
Thanks for the help!