Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRM help required

Status
Not open for further replies.

TheHut

Programmer
Jun 21, 2007
5
GB
How do I get the text from a text box to compare it.

What I want to do is take the value onChange from the 'value' text box and check that it is greater than 100, if not then alert the user the value is incorrect, clear the value they entered and put the cursor back in that box.
 
TheHut, this is some pretty basic javascript functionality. Perhaps you should read a few tutorials to get yourself familiarized with javascript before you ask more questions [small](Or ask your teacher)[/small]

Nevertheless, here's the answer to your question:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>title test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript">

function validateMe(obj) {
   if (obj.value < 100) {
      alert("value incorrect");
      obj.value = "";
      obj.focus();
   }
}

</script>
<style type="text/css"></style>
</head>
<body>

<input type="text" onchange="validateMe(this)" />

</body>
</html>

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
kaht,

Thanks for the smart comments. Unfortunately you have missed the point. I can write a simple script to get a value nd check it, as you have, but what I want to know is how to get the text from the CRM text box; this is more a CRM question than generic java script.
 
this is more a CRM question than generic java script.

Perhaps the question should be placed in a more appropriate forum then. I'm sorry I missed the point, but when a question is asked in the javascript forum I usually respond with a javascript answer.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
 
TheHut,

Given your post shows no detail about any CRM, or any code samples relating to this mysterious CRM, and given you posted in the JavaScript forum, what are we to assume if you don't give us anything to go on?

Perhaps you can help us to help you and be a bit more forthcoming in your post.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan,

Perhaps this was the wrong forum. It is specific to java scripting on CRM and since no-one seems to know know about CRM then I'll post it on another forum.

Thanks anyhow.

 
TheHut,

What CRM are you attempting to modify? Or more importantly, what toolkit is being used to decorate the textarea?

The textarea managed by the CRM backends is most likely being "decorated" using something like TinyMCE or FCKEditor (there are actually lots of them, but these are two of the more popular ones).

These toolkits usually have an exposed API to allow you to do this kind of thing. They also usually have well used forums to assist us in working with their toolkit.

Anyway, if you can answer my questions, then we can take a quick look.

Oh, and be careful how you refer to Javascript (it is not Java scripting -- this would really upset the Java developers!).

Cheers,
Jeff


[tt]Jeff's Page [!]@[/!] Code Couch
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top