Hi
I have a Title select box on my website (Mr, Mrs, Miss, etc).
Now, if they enter something that does not meet the form validation, it reloads the page and populates the fields that has already been filled out along with the appropriate error message.
Now my question is what is the best way to add the selected value that was chosen on the initial filled out form so they dont have to re-select.
Html Select - Add Selected
Started by mds1256, Dec 31 2012 09:15 AM
3 replies to this topic
#1
Posted 31 December 2012 - 09:15 AM
#2
Posted 31 December 2012 - 09:33 AM
check the value as it's being rendered and if it's the matching one from the previous submition add the selected="selected" to the option.
A simple password hash :
My SQL/PHP Blog
function makePass($word=''){
$dbSalt = '$2a$07$'.substr(hash('whirlpool',$word),0,22);
$dbPass = crypt($word, $dbSalt);
return substr($dbPass,12);
}My SQL/PHP Blog
#3
Posted 31 December 2012 - 09:37 AM
check the value as it's being rendered and if it's the matching one from the previous submition add the selected="selected" to the option.
Will that not mean there will be lots of if statements?
#4
Posted 31 December 2012 - 09:49 AM
depends on how you are populating your select element, which without code I can't see
A simple password hash :
My SQL/PHP Blog
function makePass($word=''){
$dbSalt = '$2a$07$'.substr(hash('whirlpool',$word),0,22);
$dbPass = crypt($word, $dbSalt);
return substr($dbPass,12);
}My SQL/PHP Blog
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












