Click here to Skip to main content
15,889,096 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
Im not so good in smarty so I need help,

When I submit  this form using ajax : 


    <form accept-charset="UTF-8" method="post" onSubmit="return validate()">
			<input type="text" name="code" maxlength="15" class="input-text" id="code" value="" placeholder="code">
			<input type="submit" class="button-alt-gray top1px" name="code" value="Apply" onClick="search_code()"> <br>
			</form>


			<div id="cool_number" />
 
this `<div id="cool_number" />`  gives me (prints on screen)  a value lets say 10 

and I want to pass or capture this value to a an smarty tag , I tried this:

does not work

    {$p.total = "<div id="cool_number" />"}

does not work 

    {$p.total = "<div id='cool_number' />"}

does not work 

    {$p.total = "<div id=\"cool_number\" />\n"}


What I have tried:

I tried this:

does not work

{$p.total = "<div id="cool_number" />"}

does not work

{$p.total = "<div id='cool_number' />"}

does not work

{$p.total = "<div id=\"cool_number\" />\n"}
Posted
Updated 26-Nov-16 20:02pm

1 solution

Check this out: {capture} | Smarty[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900