| | |
Textbox validate
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi everyone,
Firstly,sorry about my bad english.i hope telling my problem clearly
anyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questions
For examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
Firstly,sorry about my bad english.i hope telling my problem clearly
anyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questionsFor examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
0
#2 Nov 3rd, 2009
You could do a check on the value something like
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
if (tBox.value != ""){//proceed to next question}else{alert("Please enter a value in the textbox")}
Life... Is a Moment
•
•
Join Date: Oct 2009
Posts: 17
Reputation:
Solved Threads: 2
0
#3 Nov 4th, 2009
•
•
•
•
Hi everyone,
Firstly,sorry about my bad english.i hope telling my problem clearlyanyway i want to tell about my project.it s about survey system..I am creatin g dynamic questions and question's choices(radiobuttons or checkboxes) from database when runtime..after users answer the question,press next button to pass the next questions
For examle
1) Question definition
a)choice definition
b)choice definition
c)....
Users have to choosee any choices..if not,my system is giving alert,Actually my problem is about checkboxes..I created hidden textboxes,if question choices' type is checkbox..so the last choice definition is name "Other"..if user checks the other choice,the hidden textbox is going to be visible..it is all okay until here..I want to give a error alert if user checks the other choice and doesnt fill the textbox when press next question..I dont validate this..How can i do it..Anyone can help me?
Thanks for all...
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function check_form() { if (document.getElementById('the_other_checkbox_id').checked==true) if(document.getElementById('the_textbox_id').value=="") alert('something'); else go_to_next_question(); }
![]() |
Similar Threads
- two different validation with two different buttons. in web application (ASP.NET)
- Correct Syntax for calling a Javascript function in code behind (ASP.NET)
- How to Validate multiple textboxes using Required field / javascript function (ASP.NET)
- Manipulate Table Data...? (C#)
- NumericUpDown - No maximum or minimum (C#)
- Code Snippet: Capturing numeric input in a TextBox (C#)
- innerHTML validation problem (JavaScript / DHTML / AJAX)
- How to validate the textbox in datagrid using javascript? (ASP.NET)
- How do I validate a TAB event? (Visual Basic 4 / 5 / 6)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: responseText format??
- Next Thread: please help onClick js code
Views: 462 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxcode ajaxhelp animate api automatically beta box browser bug button calendar captchaformproblem card checkbox child class close cookies createrange() cursor dependent disablefirebug dom dropdown editor element engine events explorer ext file firehose flash form forms game google gwt gxt highlightedword html htmlform ie8 iframe image() images internet java javascript jawascriptruntimeerror jquery jsf jsfile jump margin math matrixcaptcha microsoft mimic mp3 mysql object offline onmouseoutdivproblem onreadystatechange parent passing pdf php player post progressbar rated regex runtime scroll search session shopping size solutions sql star stars stretch synchronous text textarea twitter validation web website window windowofwords windowsxp wysiwyg xml xspf \n





