|
Posted by Silvertype on 11/02/07 18:58
Yup, I have looked into google already. There are indeed a lot of info on
regex but unfortunately, due to my closing project deadline, I do not have
time to go through all of them. Therefore, I would greatly appreciate if you
(or anyone reading this) can provide me with a slightly more comprehensive
solution. Thanks again.
"Darko" <darko.maksimovic@gmail.com> wrote in message
news:1194028825.531817.309290@z9g2000hsf.googlegroups.com...
> On Nov 2, 5:35 pm, "Silvertype" <roger...@singnet.com.sg> wrote:
>> Hi guys,
>>
>> I have these html tags:
>>
>> <input type="text" id="txtName" name="txtName" />
>>
>> <textarea id="taHello" name="taHello">hello world</textarea>
>>
>> which I want to replace with the following tags:
>>
>> <input type="text" id="txtName" name="txtName" onClick="setName()" />
>>
>> <textarea id="taHello" name="taHello" onClick="setName()">hello
>> world</textarea>
>>
>> I know that it can be done by using preg_replace but I haven't really
>> figured out how to use it. Any help would be greatly appreciated. Thanks
>> in
>> advance.
>
> Hmm... are you trying to say that you want to add the same event
> handler to all inputs and textareas, or this event handler depends on
> the tag and its contents, and it's not only inputs and textareas?
>
> Anyway, you should read about regular expressions (google search will
> give you A LOT of information about them - <a href="http://
> www.google.com/search?q=regular+expressions&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a">google
> search about regular expressions</a>), and php.net about preg_replace
> (http://www.php.net/preg_replace). That's all you need.
>
> Cheers
>
Navigation:
[Reply to this message]
|