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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jQuery How do I load a URL with parameters and script block 1

Status
Not open for further replies.

AndyInNC

Programmer
Sep 22, 2008
76
0
0
US
Here is the code; it's pretty simple:

Code:
[COLOR=#3465A4]var[/color] sURL = [COLOR=#CC0000]"Edit/?iAction=2&sGroup="[/color] + sGroupName;

$([COLOR=#CC0000]'#sGroupNameIsValid'[/color]).load(sURL + [COLOR=#CC0000]' #div_Results'[/color], [COLOR=#3465A4]function[/color](){});

It works just fine...

...until I add a space in the sGroupName variable.

The user enters some text for a new data item. All I want to do is alert them / prevent them from adding something that is already there. (The URL has other things going on, so I have put the lookup value into a DIV.)

Any thoughts?

Thanks!
 
.until I add a space in the sGroupName variable.

If there is a space in the value you MUST URL encode the value.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top