This is a discussion on "javascript alert message!" within the JavaScript Forum section. This forum, and the thread "javascript alert message! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
javascript alert message!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
javascript alert message!
I have a textbox...named "bnBookingStatus"..
I want to create a javascript alert message if the value in the two textbox is like the LOGIc below when i trying to submit the form:- bnBookingStatus="DISAPPROVE" && reason="" If "bnBookingStatus" textbox value is "DISAPPROVE" and "reason" textbox value is empty,"" then alert that user to fill in the "reason" textbox! alert("You must specify the disapproval reason!"); If the "bnBookingStatus" textbox value is "APPROVED", then set the value of the textbox "reason" to be "YOUR BOOKING HAS BEEN PROCESSED!" If it is pending, DO NOTHING!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
|
|
||||
|
NOT TESTED!!!!!!
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
hey...thanx spinal007
just a tought, you are using a DROP DOWN menu to change the textbox! but i dont want to do that. I prefer using the text link:
so.... Can I put the onClick="Validate(this.value)" in my submit button? will it work? Validate(this.value)??
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
you can still use a select box when the data comes from a database. like this:
and if you want the validation to happen ONLY when the submit button is clicked, you can use this: <INPUT type=submit onclick="return Validate(document.getElementById('status').value); " value="submit"> the keyword "this" refers to the object itself, e.g.: <input type=button MyProperty="some text" onClick="alert(this.MyProperty);" value="click me">
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
Ok, let me try them out first...
in the mean time i have another doubt! i have a disable text field in my form... i have used this code on a text link to enable field.. [code] [b]TEXT LINK When i click the TEXT LINK, the value of textbox which ID is "status" will be set to "APPROVED" and at the same time it will enable the textbox which ID is "reason"?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
<blockquote id="quote" class="ffs">quote:<hr height="1" noshade="noshade" id="quote" />document.getElementById('reason').readonly=true@f alse;<hr height="1" noshade="noshade" id="quote" /></blockquote id="quote">
i've never seen the "@" in javascript..... not sure. by the way, carefull with the disabled property because disabled elements don't get submitted with the form. if you still want them to be submited you should use readonly instead. I'm not sure, but change the readonly on a field I think all you have to say is: document.getElementById('status').readonly = false; or document.getElementById('status').readonly = true; unless the readonly property is in fact, readonly itself, but I think it shoud be fine. and finally, the link: <A href="#" onClick=" document.getElementById('status').value = "approved"; document.getElementById('status').readonly = true; document.getElementById('reason').value = "gimme a reason"; document.getElementById('reason').readonly = true;"> approved</A> can you put this page on the web so I can look at it. I really think you should be using functions to do this......
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
ok...
I think that helps me alot, Thanx! About the @, I put it like that because i am not sure of the truth value of it So.. TEXT LINK this code should be working then? let say that the readonly properties is readonly itself, can I make it readonly=true; or readonly=false;? Can I change the readonly textbox if I set the textbox to readonly?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
|
|
||||
|
if you set a textbox to readonly, you can still use scripting to change the text in it,
I just wasn't sure that once the page is loaded whether you can change the readonly property but you should be able to. should be fine.......
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| javascript, alert, message |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Javascript warning message | finchita | JavaScript Forum | 5 | May 18th, 2008 17:34 |
| Alert Box | acrikey | JavaScript Forum | 4 | Mar 25th, 2008 23:23 |
| alert Message messing up | sdbdgwood | JavaScript Forum | 0 | Feb 8th, 2008 16:15 |
| javascript alert | ycpc55 | JavaScript Forum | 1 | Jan 7th, 2007 02:02 |
| Newbie alert..... | pagey | Introduce Yourself | 11 | Sep 2nd, 2006 08:55 |