Jump to content

How to change the textarea into input element


Recommended Posts

product.tpl file,

you've got there code:

{foreach from=$customizationFields item='field' name='customizationFields'}
						{if $field.type == 1}
						<li class="customizationUploadLine{if $field.required} required{/if}">
							<label for ="textField{$customizationField}">{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field} {if !empty($field.name)}{$field.name}{/if}{if $field.required}<sup>*</sup>{/if}</label>
							<textarea name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>
						</li>
						{counter}
						{/if}
					{/foreach}

change textarea to input:

<textarea name="textField{$field.id_customization_field}" id="textField{$customizationField}" rows="1" cols="40" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</textarea>

remember to use the same name, id and also value :)

Link to comment
Share on other sites

Hello,

 

Thank you for your help.

 

I changed the textarea wint input like this:

 

<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" class="customization_block_input">{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}</input>

 

Is this correct?

 

Because when I click on "Enregistrer" I have this:

 

post-716014-0-34827300-1384844155_thumb.png

 

and the values are not saved.

 

Regards

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...