I'm trying to update a variable in AMPscript in order to get a list of values that contain a keyword. This value is inserted in an input and after that I click on a search button to find the results. I tried adding some jQuery code but this has not worked. How can I get the value of the input into my AMPscript and refresh the table with the values?
This is my current code:
<div>
<label for="keyword">Please enter a keyword for search</label>
<input type="text" id="keyword" name="keyword">
<button id="searchBtn">Search</button>
</div>
<div id="content">
%%[
var @rows, @rowcount, @i, @code, @value, @keyword
set @rows = LookupRows("MyDataExtension","Active",1)
set @rowcount = RowCount(@rows)
IF @rowcount > 0 THEN]%%
<table>
<tr>
<th>Code</th>
<th>Value</th>
</tr>
%%[
FOR @i = 1 TO @rowcount DO
set @row = Row(@rows, @i)
set @code = Field(@row,"Code")
set @value = Field(@row,"Value")
]%%
<tr>
<td>%%=v(@code)=%%</td>
<td>%%=v(@value)=%%</td>
</tr>
%%[NEXT @i]%%
</table>
%%[ELSE]%%
<p>
No Account Records
</p>
%%[ENDIF]%%
</div>