Jump to content

code problem and i have no clue


menorcarob

Recommended Posts

hi all

 

i am not very good with php, i understand some of how it works and i am trying to learn more, but it taking a long time, age thing i guess. i have bought a script after trying for months to learn to use NOF 10 to create a site, the script is good but the support is pretty grim and very slow.

the problem i have is that the form that people register on and others such as the search form, and the listing submission form all have the dropdown option of country what i need to do is make the country always "spain" and not show the option on the form, the author of the script suggested this...........

 

"Well, hmmm ... how about if you convert them into hidden fields and put

the default value there. Then you can hide these fields, but actually

it will still be there when the form is submitted.

 

Please try that."

 

simples eh, not for me, i have tried but i am getting nowhere, could you please look at the script and tell me where i should edit it to remove the country from view with the default of spain option on the form, many thanks in advance

 

robin 

 

here is the script........

<tr>

<td><font class="{$warning_member_country}"><b>Country</b></font> <font class="normal_12_red">*</font></td>

<td><b>:</b></td>

<td>

<select name="member_country" class="textbox" style="width:350px">

{section name=var loop=$member_country}

<option value="{$member_country_id[var]}" {if $member_country_id[var] == $cmember_country} selected {/if}>{$member_country_name[var]}</option>

{/section}

</select>

{php} $_SESSION['cmember_country_warn'] = ''; {/php}

</td>

</tr>

 

Link to comment
https://forums.phpfreaks.com/topic/150466-code-problem-and-i-have-no-clue/
Share on other sites

Maybe you need to replace

<select name="member_country" class="textbox" style="width:350px">
{section name=var loop=$member_country}
<option value="{$member_country_id[var]}" {if $member_country_id[var] == $cmember_country} selected {/if}>{$member_country_name[var]}</option>
{/section}
</select>

 

With

<input type="hidden" name="member_country" value="Spain">

 

Spain may need to be changed to whatever the value is for spain

 

 

disaster

 

when i checked properly it does not give spain it gives "Afghanistan" which is the first value in the list, below is how the entry in the scropt looks now.

 

 

<tr>

<td><input type="hidden" name="member_country" value="Spain">

</td>

</tr>

 

<tr>

 

what can i do next

thanks

robin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.