Hello everybody!! I have a small issue: I have the following code: state0: { html:'EXAMPLE TEXT<div class="field"><table width="100%"><tr><td>Name</td><td><input type="text" id="Name" name="name" value="" /></td></tr></table></div>', buttons: { Cancel: false, Continue: true}, focus: 1, submit:function(v,m,f){ if(v==0) $.prompt.close() else if(v==1) { [COLOR="#FF0000"]if( name isn't empty )[/COLOR] execute -> $.prompt.goToState('state1');}//go forward if not make the input border red? return false; } Code (markup): 1.How should I write the red if, if I want to get to the next state (state1) only if name isn't empty? (I know how to write the condition in php, but here I don't know how to get the name value) 2.How do I make the names input border red if the condition is not respected? Please help me with a code because I feel that I'm loosing my mind.. Thanks a lot
Hi, use the getElementById method to retrieve the input, the value property of the input to get its value and the border style property to change its border settings: submit:function(v,m,f){ if (v==0) { $.prompt.close(); } else if(v==1) { var input = document.getElementById ("name"); if (input.value) { input.style.border = ""; return false; } else { input.style.border = "2px solid red"; } } return true; } Code (markup):